From 75430891794ac41af3b1111453e8972d9ca6b70b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugo=20H=C3=B6rnquist?= Date: Thu, 6 Aug 2020 18:55:25 +0200 Subject: Fix popup when creating and deleting in week. --- module/output/html.scm | 1 - static/script.js | 11 ++--------- 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/module/output/html.scm b/module/output/html.scm index 4fc08d3b..9aacfebe 100644 --- a/module/output/html.scm +++ b/module/output/html.scm @@ -201,7 +201,6 @@ ,(when (and (prop ev 'PARTSTAT) (eq? 'TENTATIVE (prop ev 'PARTSTAT))) " tentative")) - ; (onclick "toggle_child_popup(this)") (onclick ,(format #f "toggle_popup('~a')" (string-append "popup" (html-id ev)))) ))) diff --git a/static/script.js b/static/script.js index 1bd0bb95..db5b818e 100644 --- a/static/script.js +++ b/static/script.js @@ -252,7 +252,7 @@ async function remove_event (element) { }); console.log(response); - toggle_child_popup(element); + toggle_popup("popup" + element.id); if (response.status < 200 || response.status >= 300) { let body = await response.text(); @@ -333,7 +333,6 @@ async function create_event (event) { } let body = await response.text(); - console.log(body); /* servere is assumed to return an XML document on the form @@ -360,7 +359,7 @@ async function create_event (event) { event.classList.remove("generated"); event.classList.add("CAL_Calendar"); - toggle_child_popup(event); + toggle_popup("popup" + event.id); } function place_in_edit_mode (event) { @@ -585,7 +584,6 @@ function open_popup(popup) { function toggle_popup(popup_id) { let popup = document.getElementById(popup_id); - // popup.classList.toggle("visible"); if (popup.classList.contains("visible")) { close_popup(popup); } else { @@ -593,11 +591,6 @@ function toggle_popup(popup_id) { } } -function toggle_child_popup(el) { - let popup = el.getElementsByClassName("popup-container")[0]; - toggle_popup(popup); -} - function datepad(thing, width=2) { return (thing + "").padStart(width, "0"); } -- cgit v1.2.3