diff options
author | Devaev Maxim <[email protected]> | 2018-12-18 23:25:23 +0300 |
---|---|---|
committer | Devaev Maxim <[email protected]> | 2018-12-18 23:28:08 +0300 |
commit | 3e7b5bf04908dbcf14bbeafc052bce9c51bb6b2c (patch) | |
tree | 9d7d008bb4f65769beeb2196dd7d4cae8143a169 /web/share/js/wm.js | |
parent | 8867b32356d0731dfffa2687e669cb9462f206b8 (diff) |
refactoring
Diffstat (limited to 'web/share/js/wm.js')
-rw-r--r-- | web/share/js/wm.js | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/web/share/js/wm.js b/web/share/js/wm.js index 5dae326d..550c7a32 100644 --- a/web/share/js/wm.js +++ b/web/share/js/wm.js @@ -8,19 +8,19 @@ function WindowManager() { var __menu_items = []; var __init__ = function() { - Array.prototype.forEach.call(document.querySelectorAll("button"), function(el_button) { + tools.forEach($$$("button"), function(el_button) { // XXX: Workaround for iOS Safari: // https://stackoverflow.com/questions/3885018/active-pseudo-class-doesnt-work-in-mobile-safari el_button.ontouchstart = function() {}; }); - Array.prototype.forEach.call($$("menu-item"), function(el_item) { + tools.forEach($$("menu-item"), function(el_item) { el_item.parentElement.querySelector(".menu-item-content").setAttribute("tabindex", "-1"); tools.setOnDown(el_item, () => __toggleMenu(el_item)); __menu_items.push(el_item); }); - Array.prototype.forEach.call($$("window"), function(el_window) { + tools.forEach($$("window"), function(el_window) { el_window.setAttribute("tabindex", "-1"); __makeWindowMovable(el_window); __windows.push(el_window); @@ -258,7 +258,7 @@ function WindowManager() { var __organizeWindowsOnResize = function(orientation) { var view = self.getViewGeometry(); - Array.prototype.forEach.call($$("window"), function(el_window) { + tools.forEach($$("window"), function(el_window) { if (el_window.style.visibility === "visible" && (orientation || el_window.hasAttribute("data-centered"))) { var rect = el_window.getBoundingClientRect(); |