summaryrefslogtreecommitdiff
path: root/web/share/js
diff options
context:
space:
mode:
Diffstat (limited to 'web/share/js')
-rw-r--r--web/share/js/kvm/main.js9
-rw-r--r--web/share/js/wm.js6
2 files changed, 10 insertions, 5 deletions
diff --git a/web/share/js/kvm/main.js b/web/share/js/kvm/main.js
index e32992a9..c71e7fd6 100644
--- a/web/share/js/kvm/main.js
+++ b/web/share/js/kvm/main.js
@@ -50,9 +50,14 @@ export function main() {
tools.el.setOnClick($("open-log-button"), () => window.open("/api/log?seek=3600&follow=1", "_blank"));
- if (tools.config.getBool("kvm--full-tab-stream", false)) {
- wm.toggleFullTabWindow($("stream-window"), true);
+ tools.storage.bindSimpleSwitch(
+ $("page-full-tab-stream-switch"),
+ "page.full_tab_stream",
+ tools.config.getBool("kvm--full-tab-stream", false));
+ if ($("page-full-tab-stream-switch").checked) {
+ wm.setFullTabWindow($("stream-window"), true);
}
+
wm.showWindow($("stream-window"));
new Session();
diff --git a/web/share/js/wm.js b/web/share/js/wm.js
index 1c1b67df..162f43ba 100644
--- a/web/share/js/wm.js
+++ b/web/share/js/wm.js
@@ -111,8 +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";
- 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));
+ tools.el.setOnClick(el_enter_full_tab_button, () => self.setFullTabWindow(el_window, true));
+ tools.el.setOnClick(el_exit_full_tab_button, () => self.setFullTabWindow(el_window, false));
}
let el_full_screen_button = el_window.querySelector(".window-header .window-button-full-screen");
@@ -334,7 +334,7 @@ function __WindowManager() {
__activateLastWindow(el_window);
};
- self.toggleFullTabWindow = function(el_window, enabled) {
+ self.setFullTabWindow = function(el_window, enabled) {
el_window.classList.toggle("window-full-tab", enabled);
__activateLastWindow(el_window);
let el_navbar = $("navbar");