aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--module/output/html.scm5
-rw-r--r--static/script.js10
2 files changed, 9 insertions, 6 deletions
diff --git a/module/output/html.scm b/module/output/html.scm
index be48a636..14848335 100644
--- a/module/output/html.scm
+++ b/module/output/html.scm
@@ -164,14 +164,13 @@
"unknown"))))
,(btn "×"
title: "Stäng"
- onclick: ""
+ onclick: (format #f "close_popup(~a)" id)
class: '("close-tooltip"))
,(btn "🗑"
title: "Ta bort"
;; Apparently an id gets recieved
;; as the whole object in js.
- onclick: (format #f "remove_event(~a)"
- id)))
+ onclick: (format #f "remove_event(~a)" id)))
,(tabset
(append
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");