mirror of
https://github.com/mofeng-git/One-KVM.git
synced 2025-12-13 01:30:31 +08:00
close menues using esc key
This commit is contained in:
parent
01e5a8caee
commit
55da818b8e
@ -5,7 +5,12 @@ var ui = new function() {
|
|||||||
|
|
||||||
this.init = function() {
|
this.init = function() {
|
||||||
Array.prototype.forEach.call(document.getElementsByClassName("ctl-item"), function(el_item) {
|
Array.prototype.forEach.call(document.getElementsByClassName("ctl-item"), function(el_item) {
|
||||||
el_item.onclick = function() { __toggleMenu(el_item); };
|
el_item.onclick = () => __toggleMenu(el_item);
|
||||||
|
el_item.onkeyup = function(event) {
|
||||||
|
if (event.code == "Escape") {
|
||||||
|
__toggleMenu(el_item);
|
||||||
|
}
|
||||||
|
};
|
||||||
__ctl_items.push(el_item);
|
__ctl_items.push(el_item);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user