refactoring

This commit is contained in:
Devaev Maxim
2021-04-13 10:14:27 +03:00
parent 6de0ee0017
commit 5dc123e186
6 changed files with 11 additions and 9 deletions

View File

@@ -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"));

View File

@@ -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() {
// При переполнении рабочей области сократить размер окна по высоте.