aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHugo Hörnquist <hugo@lysator.liu.se>2020-10-05 02:37:17 +0200
committerHugo Hörnquist <hugo@lysator.liu.se>2020-10-05 02:37:17 +0200
commitc0fe5487f4c46ac05a5a2bda40e0d8150bf38690 (patch)
tree8bd4c4c36384057507013eef160a6b8e3fa4179f
parentLocation and Property can now be added. (diff)
downloadcalp-c0fe5487f4c46ac05a5a2bda40e0d8150bf38690.tar.gz
calp-c0fe5487f4c46ac05a5a2bda40e0d8150bf38690.tar.xz
Bind new form for cloned events.
-rw-r--r--static/script.js8
1 files changed, 6 insertions, 2 deletions
diff --git a/static/script.js b/static/script.js
index f116deaf..d218bf9f 100644
--- a/static/script.js
+++ b/static/script.js
@@ -64,6 +64,11 @@ class EventCreator {
let event = document.getElementById("event-template").firstChild.cloneNode(true);
let popup = document.getElementById("popup-template").firstChild.cloneNode(true);
+ popup.getElementsByClassName("edit-form")[0].onsubmit = function () {
+ create_event(event);
+ return false; /* stop default */
+ }
+
let id = gensym ("__js_event");
// TODO remove button?
@@ -577,8 +582,7 @@ window.onload = function () {
/* TODO this doesn't yet apply to newly created events */
let popup = document.getElementById("popup" + el.id);
- let form = popup.getElementsByClassName("edit-form")[0];
- form.onsubmit = function () {
+ popup.getElementsByClassName("edit-form")[0].onsubmit = function () {
create_event(el);
return false; /* stop default */
}