summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBent Bisballe Nyeng <deva@aasimon.org>2020-06-16 16:55:55 +0200
committerBent Bisballe Nyeng <deva@aasimon.org>2020-06-16 16:55:55 +0200
commit2cf928d0af9674c7a4d20eed4c10494608157312 (patch)
tree85fec2be30209d4b22bd78bc3f3661276ee4acd4 /src
parenta0c7776dc0f97c5ef6ba64e30d1f3cf2eb7c35d2 (diff)
Make html content of descriptions click-through to be able to edit them with double-click.
Diffstat (limited to 'src')
-rw-r--r--src/ws/node.js10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/ws/node.js b/src/ws/node.js
index 439165b..b99882b 100644
--- a/src/ws/node.js
+++ b/src/ws/node.js
@@ -271,6 +271,15 @@ function checkHTML(html)
return true;
}
+function makeClickthrough(e)
+{
+ var elements = e.getElementsByTagName("*");
+ for(let element of elements)
+ {
+ element.style.pointerEvents = "none"; // enable clickthrough to parent
+ }
+}
+
Node.prototype.setAttribute = function(name, value)
{
this.attributes[name] = value;
@@ -295,6 +304,7 @@ Node.prototype.setAttribute = function(name, value)
{
// Insert as HTML
this.description_element.innerHTML = value;
+ makeClickthrough(this.description_element);
}
else
{