aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/js/urweb.js19
1 files changed, 13 insertions, 6 deletions
diff --git a/lib/js/urweb.js b/lib/js/urweb.js
index 1a275451..d8198ed0 100644
--- a/lib/js/urweb.js
+++ b/lib/js/urweb.js
@@ -1286,11 +1286,12 @@ function dynClass(pnode, html, s_class, s_style) {
if (pnode == "table" && html.tagName == "TBODY") {
html = html.firstChild;
}
- addNode(html);
- runScripts(html);
+
+ var x = null;
+ var y = null;
if (s_class) {
- var x = document.createElement("script");
+ x = document.createElement("script");
x.dead = false;
x.signal = s_class;
x.sources = null;
@@ -1305,13 +1306,12 @@ function dynClass(pnode, html, s_class, s_style) {
x.closures = concat(cls.v, htmlCls);
}
- html.appendChild(x);
populate(x);
}
if (s_style) {
var htmlCls2 = s_class ? null : htmlCls;
- var y = document.createElement("script");
+ y = document.createElement("script");
y.dead = false;
y.signal = s_style;
y.sources = null;
@@ -1326,9 +1326,16 @@ function dynClass(pnode, html, s_class, s_style) {
y.closures = concat(cls.v, htmlCls2);
}
- html.appendChild(y);
populate(y);
}
+
+ addNode(html);
+ runScripts(html);
+
+ if (x)
+ html.appendChild(x);
+ if (y)
+ html.appendChild(y);
}
function bodyDynClass(s_class, s_style) {