aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHugo Hörnquist <hugo@lysator.liu.se>2020-08-06 18:55:25 +0200
committerHugo Hörnquist <hugo@lysator.liu.se>2020-08-06 18:55:25 +0200
commit75430891794ac41af3b1111453e8972d9ca6b70b (patch)
treeea33f4d6ad733739896fb4d6c62e3fefbe2a812d
parentFix most of event creation problems in week. (diff)
downloadcalp-75430891794ac41af3b1111453e8972d9ca6b70b.tar.gz
calp-75430891794ac41af3b1111453e8972d9ca6b70b.tar.xz
Fix popup when creating and deleting in week.
-rw-r--r--module/output/html.scm1
-rw-r--r--static/script.js11
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
<properties>
@@ -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");
}