diff options
Diffstat (limited to '')
-rw-r--r-- | static/script.js | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/static/script.js b/static/script.js index 6bb55c2f..7cd99bef 100644 --- a/static/script.js +++ b/static/script.js @@ -151,9 +151,12 @@ function new_popup (event) { // if (event.target !== this) return; /* popup = this.children[0].children[0] */ - popup = this.parentElement.parentElement.getElementsByClassName("popup")[0]; + let ev = parents_until(this, {class: "event"}) + popup = ev.getElementsByClassName("popup")[0]; popup.classList.toggle("show") + return; + /* x-axis fix */ /* Popup should neven be wider than viewport */ @@ -218,7 +221,9 @@ window.onload = function () { // } days = document.getElementsByClassName("days")[0] - for (let e of days.getElementsByClassName("body")) { + for (let popup of document.getElementsByClassName("popup")) { + ev = parents_until(popup, {class: "event"}) + e = ev.getElementsByClassName("body")[0] e.onclick = new_popup; e.parentElement.href = "#"; } |