mirror of
https://github.com/mofeng-git/One-KVM.git
synced 2026-02-01 10:31:54 +08:00
close menues on start dragging windows
This commit is contained in:
@@ -101,18 +101,28 @@ var ui = new function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
if (all_hidden) {
|
if (all_hidden) {
|
||||||
__raiseLastWindow();
|
|
||||||
document.onkeyup = null;
|
document.onkeyup = null;
|
||||||
|
__raiseLastWindow();
|
||||||
} else {
|
} else {
|
||||||
document.onkeyup = function(event) {
|
document.onkeyup = function(event) {
|
||||||
if (event.code == "Escape") {
|
if (event.code == "Escape") {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
__toggleMenu(null);
|
__closeAllMenues();
|
||||||
|
__raiseLastWindow();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
var __closeAllMenues = function() {
|
||||||
|
document.onkeyup = null;
|
||||||
|
__ctl_items.forEach(function(el_item) {
|
||||||
|
var el_menu = el_item.parentElement.querySelector(".ctl-dropdown-content");
|
||||||
|
el_item.classList.remove("ctl-item-selected");
|
||||||
|
el_menu.style.display = "none";
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
var __globalMouseButtonHandler = function(event) {
|
var __globalMouseButtonHandler = function(event) {
|
||||||
hid.updateLeds();
|
hid.updateLeds();
|
||||||
if (!event.target.matches(".ctl-item")) {
|
if (!event.target.matches(".ctl-item")) {
|
||||||
@@ -124,7 +134,8 @@ var ui = new function() {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
__toggleMenu(null);
|
__closeAllMenues();
|
||||||
|
__raiseLastWindow();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -133,6 +144,7 @@ var ui = new function() {
|
|||||||
var prev_y = 0;
|
var prev_y = 0;
|
||||||
|
|
||||||
function startMoving(event) {
|
function startMoving(event) {
|
||||||
|
__closeAllMenues();
|
||||||
__raiseWindow(el_window);
|
__raiseWindow(el_window);
|
||||||
event = (event || window.event);
|
event = (event || window.event);
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
|
|||||||
Reference in New Issue
Block a user