diff options
author | Devaev Maxim <[email protected]> | 2018-08-31 17:48:36 +0300 |
---|---|---|
committer | Devaev Maxim <[email protected]> | 2018-08-31 17:48:36 +0300 |
commit | ecb866f57a983f22e67b74b0bef45a3f211a3d0f (patch) | |
tree | 1c37c80be5cce49a34bd18fcfc5a10e39794daeb /kvmd/web/js/ui.js | |
parent | 1bf3506d2e72eba65d8c7d187151a51cf0abcf6d (diff) |
testing mouse buttons for touch interface
Diffstat (limited to 'kvmd/web/js/ui.js')
-rw-r--r-- | kvmd/web/js/ui.js | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/kvmd/web/js/ui.js b/kvmd/web/js/ui.js index 60284d61..6b519bdc 100644 --- a/kvmd/web/js/ui.js +++ b/kvmd/web/js/ui.js @@ -8,6 +8,12 @@ function Ui() { var __ctl_items = []; var __init__ = function() { + Array.prototype.forEach.call(document.querySelectorAll("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($$("ctl-item"), function(el_item) { el_item.onclick = () => __toggleMenu(el_item); __ctl_items.push(el_item); @@ -85,12 +91,14 @@ function Ui() { var el_cancel_button = document.createElement("button"); el_cancel_button.innerHTML = "Cancel"; el_cancel_button.onclick = () => close(false); + el_cancel_button.ontouchstart = function() {}; el_buttons.appendChild(el_cancel_button); } if (ok) { var el_ok_button = document.createElement("button"); el_ok_button.innerHTML = "OK"; el_ok_button.onclick = () => close(true); + el_cancel_button.ontouchstart = function() {}; el_buttons.appendChild(el_ok_button); } if (ok && cancel) { |