diff options
author | Hugo Hörnquist <hugo@lysator.liu.se> | 2020-10-05 02:37:17 +0200 |
---|---|---|
committer | Hugo Hörnquist <hugo@lysator.liu.se> | 2020-10-05 02:37:17 +0200 |
commit | c0fe5487f4c46ac05a5a2bda40e0d8150bf38690 (patch) | |
tree | 8bd4c4c36384057507013eef160a6b8e3fa4179f | |
parent | Location and Property can now be added. (diff) | |
download | calp-c0fe5487f4c46ac05a5a2bda40e0d8150bf38690.tar.gz calp-c0fe5487f4c46ac05a5a2bda40e0d8150bf38690.tar.xz |
Bind new form for cloned events.
Diffstat (limited to '')
-rw-r--r-- | static/script.js | 8 |
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 */ } |