diff options
author | Hugo Hörnquist <hugo@lysator.liu.se> | 2020-07-10 19:55:50 +0200 |
---|---|---|
committer | Hugo Hörnquist <hugo@lysator.liu.se> | 2020-07-10 19:55:50 +0200 |
commit | 9afb9e2c0a08cf0a175afb32bb47023de7db35d7 (patch) | |
tree | 3edfd3074bfa4c9dd3c4c0ddf50b74d0de587965 /static/script.js | |
parent | Serve xml under .html, month view xhtml content-type. (diff) | |
download | calp-9afb9e2c0a08cf0a175afb32bb47023de7db35d7.tar.gz calp-9afb9e2c0a08cf0a175afb32bb47023de7db35d7.tar.xz |
Fix popup close buttons, and ESC to close all.
Diffstat (limited to 'static/script.js')
-rw-r--r-- | static/script.js | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/static/script.js b/static/script.js index e7076f81..484eeb6c 100644 --- a/static/script.js +++ b/static/script.js @@ -258,9 +258,9 @@ function setVar(str, val) { } function close_all_popups () { - for (let popup of document.getElementsByClassName("tpd-tooltip")) { - popup.getElementsByClassName('close-tooltip')[0].click(); - } + for (let popup of document.querySelectorAll(".popup-container.visible")) { + close_popup(popup); + } } function sxml_to_xml(doc, tree) { @@ -408,6 +408,10 @@ window.onload = function () { } +function close_popup(popup) { + popup.classList.remove("visible"); +} + function toggle_child_popup(el) { let popup = el.getElementsByClassName("popup-container")[0]; popup.classList.toggle("visible"); |