aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHugo Hörnquist <hugo@lysator.liu.se>2020-11-05 23:32:34 +0100
committerHugo Hörnquist <hugo@lysator.liu.se>2020-11-05 23:32:34 +0100
commit6c4b85226a119b1e5e95e0f10ea507ff3c1778f8 (patch)
tree5f8e4e9d583eb7d90f4d1554d325f9ebd338865d
parentChange recovery on unexpected ',' in TEXT field. (diff)
downloadcalp-6c4b85226a119b1e5e95e0f10ea507ff3c1778f8.tar.gz
calp-6c4b85226a119b1e5e95e0f10ea507ff3c1778f8.tar.xz
Introduce event_from_popup and vice versa.
-rw-r--r--static/script.js12
1 files changed, 10 insertions, 2 deletions
diff --git a/static/script.js b/static/script.js
index e55780f6..8445c715 100644
--- a/static/script.js
+++ b/static/script.js
@@ -650,6 +650,14 @@ window.onload = function () {
}
+function event_from_popup(popup) {
+ return document.getElementById(popup.id.substr(5))
+}
+
+function popup_from_event(event) {
+ return document.getElementById("popup" + event.id);
+}
+
function close_popup(popup) {
popup.classList.remove("visible");
}
@@ -662,7 +670,7 @@ function close_all_popups () {
function open_popup(popup) {
popup.classList.add("visible");
- let element = document.getElementById(popup.id.substr(5))
+ let element = event_from_popup(popup);
// let root = document.body;
let root;
switch (VIEW) {
@@ -766,7 +774,7 @@ class vcomponent {
function bind_properties (el, wide_event=false) {
el.properties = {}
- let popup = document.getElementById("popup" + el.id);
+ let popup = popup_from_event(el);
// let children = el.getElementsByTagName("properties")[0].children;
/* actual component (not popup) */