From 5dc123e1860be5e582de1ed4341296c3c3f649da Mon Sep 17 00:00:00 2001 From: Devaev Maxim Date: Tue, 13 Apr 2021 10:14:27 +0300 Subject: refactoring --- web/share/js/kvm/main.js | 3 --- web/share/js/wm.js | 5 +++++ 2 files changed, 5 insertions(+), 3 deletions(-) (limited to 'web/share/js') diff --git a/web/share/js/kvm/main.js b/web/share/js/kvm/main.js index dde873c7..8150a852 100644 --- a/web/share/js/kvm/main.js +++ b/web/share/js/kvm/main.js @@ -40,9 +40,6 @@ export function main() { initWindowManager(); - tools.setOnClick($("show-about-button"), () => wm.showWindow($("about-window"))); - tools.setOnClick($("show-keyboard-button"), () => wm.showWindow($("keyboard-window"))); - tools.setOnClick($("show-stream-button"), () => wm.showWindow($("stream-window"))); tools.setOnClick($("open-log-button"), () => window.open("/api/log?seek=3600&follow=1", "_blank")); wm.showWindow($("stream-window")); diff --git a/web/share/js/wm.js b/web/share/js/wm.js index 11d86155..b74e2626 100644 --- a/web/share/js/wm.js +++ b/web/share/js/wm.js @@ -63,6 +63,11 @@ function __WindowManager() { __makeWindowMovable(el_window); __windows.push(el_window); + if (el_window.hasAttribute("data-show-by-button")) { + let el_show_button = $(el_window.getAttribute("data-show-by-button")); + tools.setOnClick(el_show_button, () => self.showWindow(el_window)); + } + if (el_window.classList.contains("window-resizable") && window.ResizeObserver) { new ResizeObserver(function() { // При переполнении рабочей области сократить размер окна по высоте. -- cgit v1.2.3