diff options
Diffstat (limited to 'web/share/js/wm.js')
-rw-r--r-- | web/share/js/wm.js | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/web/share/js/wm.js b/web/share/js/wm.js index a193610c..c8a4c109 100644 --- a/web/share/js/wm.js +++ b/web/share/js/wm.js @@ -111,16 +111,8 @@ function __WindowManager() { let el_exit_full_tab_button = el_window.querySelector(".window-button-exit-full-tab"); if (el_enter_full_tab_button && el_exit_full_tab_button) { el_enter_full_tab_button.title = "Stretch to the entire tab"; - let toggle_full_tab = function(enabled) { - el_window.classList.toggle("window-full-tab", enabled); - __activateLastWindow(el_window); - let el_navbar = $("navbar"); - if (el_navbar) { - tools.hidden.setVisible(el_navbar, !enabled); - } - }; - tools.el.setOnClick(el_enter_full_tab_button, () => toggle_full_tab(true)); - tools.el.setOnClick(el_exit_full_tab_button, () => toggle_full_tab(false)); + tools.el.setOnClick(el_enter_full_tab_button, () => self.toggleFullTabWindow(el_window, true)); + tools.el.setOnClick(el_exit_full_tab_button, () => self.toggleFullTabWindow(el_window, false)); } let el_full_screen_button = el_window.querySelector(".window-header .window-button-full-screen"); @@ -272,6 +264,15 @@ function __WindowManager() { __activateLastWindow(el_window); }; + self.toggleFullTabWindow = function(el_window, enabled) { + el_window.classList.toggle("window-full-tab", enabled); + __activateLastWindow(el_window); + let el_navbar = $("navbar"); + if (el_navbar) { + tools.hidden.setVisible(el_navbar, !enabled); + } + }; + var __closeWindow = function(el_window) { el_window.focus(); el_window.blur(); |