summaryrefslogtreecommitdiff
path: root/kvmd
diff options
context:
space:
mode:
authorDevaev Maxim <[email protected]>2018-07-28 13:38:00 +0300
committerDevaev Maxim <[email protected]>2018-07-28 13:38:00 +0300
commit55da818b8e8320e52fb02c9992e2649e280b7619 (patch)
tree2fa4a4546c680fb56c3c3f60f062a651b55bd4d0 /kvmd
parent01e5a8caeeeba2772acf5f888278e891aea09608 (diff)
close menues using esc key
Diffstat (limited to 'kvmd')
-rw-r--r--kvmd/web/js/ui.js7
1 files changed, 6 insertions, 1 deletions
diff --git a/kvmd/web/js/ui.js b/kvmd/web/js/ui.js
index 03cc9ac2..3d16ec29 100644
--- a/kvmd/web/js/ui.js
+++ b/kvmd/web/js/ui.js
@@ -5,7 +5,12 @@ var ui = new function() {
this.init = function() {
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);
});