diff options
author | Devaev Maxim <[email protected]> | 2018-11-27 17:32:36 +0300 |
---|---|---|
committer | Devaev Maxim <[email protected]> | 2018-11-27 17:32:36 +0300 |
commit | 2cea16a978f475aa2b12d49d7ac2eccfd5c6892f (patch) | |
tree | 4d3d9e2fe648c93852695e9905a7c8854a592c6f /web/js/ui.js | |
parent | 8c3f604e4a64fa6b81da30d6d3cba6c9dc0d9d71 (diff) |
blur logic
Diffstat (limited to 'web/js/ui.js')
-rw-r--r-- | web/js/ui.js | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/web/js/ui.js b/web/js/ui.js index b4c13536..e3877191 100644 --- a/web/js/ui.js +++ b/web/js/ui.js @@ -39,6 +39,11 @@ function Ui() { window.onmouseup = __globalMouseButtonHandler; window.ontouchend = __globalMouseButtonHandler; + window.addEventListener("focus", () => __activateLastWindow()); + window.addEventListener("pagehide", () => __deactivateAllWindows()); + window.addEventListener("pagehide", __closeAllMenues); + window.addEventListener("blur", () => __deactivateAllWindows()); + window.addEventListener("blur", __closeAllMenues); window.addEventListener("resize", () => __organizeWindowsOnResize(false)); window.addEventListener("orientationchange", () => __organizeWindowsOnResize(true)); }; |