summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--web/share/js/wm.js13
1 files changed, 9 insertions, 4 deletions
diff --git a/web/share/js/wm.js b/web/share/js/wm.js
index 23d64af3..f4a0dbee 100644
--- a/web/share/js/wm.js
+++ b/web/share/js/wm.js
@@ -62,7 +62,7 @@ function __WindowManager() {
let el_button = el_window.querySelector(".window-header .window-button-close");
if (el_button) {
tools.setOnClick(el_button, function() {
- el_window.style.visibility = "hidden";
+ __closeWindow(el_window);
__activateLastWindow(el_window);
});
}
@@ -111,7 +111,7 @@ function __WindowManager() {
el_window.appendChild(el_buttons);
function close(retval) {
- el_window.style.visibility = "hidden";
+ __closeWindow(el_window);
el_modal.outerHTML = "";
let index = __windows.indexOf(el_modal);
if (index !== -1) {
@@ -208,6 +208,12 @@ function __WindowManager() {
};
};
+ var __closeWindow = function(el_window) {
+ el_window.focus();
+ el_window.blur();
+ el_window.style.visibility = "hidden";
+ };
+
var __toggleMenu = function(el_a) {
let all_hidden = true;
@@ -354,8 +360,7 @@ function __WindowManager() {
tools.debug("UI: Activating last window:", el_last_window);
__activateWindow(el_last_window);
} else {
- tools.debug("UI: Unsetting focuse because no windows left");
- document.activeElement.blur();
+ tools.debug("UI: No last window to activation");
}
};