aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib/js/urweb.js
diff options
context:
space:
mode:
Diffstat (limited to 'lib/js/urweb.js')
-rw-r--r--lib/js/urweb.js13
1 files changed, 11 insertions, 2 deletions
diff --git a/lib/js/urweb.js b/lib/js/urweb.js
index bf20cfd4..f81f05e3 100644
--- a/lib/js/urweb.js
+++ b/lib/js/urweb.js
@@ -1310,6 +1310,9 @@ function dynClass(pnode, html, s_class, s_style) {
var x = null;
var y = null;
+ var classNameBefore = html.className;
+ var styleCssBefore = html.style.cssText;
+
if (s_class) {
x = document.createElement("script");
x.dead = false;
@@ -1322,7 +1325,10 @@ function dynClass(pnode, html, s_class, s_style) {
freeClosure(ls.data);
var cls = {v : null};
- html.className = flatten(cls, v);
+ var s = flatten(cls, v);
+ if (classNameBefore)
+ s += " " + classNameBefore;
+ html.className = s;
x.closures = concat(cls.v, htmlCls);
}
@@ -1342,7 +1348,10 @@ function dynClass(pnode, html, s_class, s_style) {
freeClosure(ls.data);
var cls = {v : null};
- html.style.cssText = flatten(cls, v);
+ var s = flatten(cls, v);
+ if (styleCssBefore)
+ s += " " + styleCssBefore;
+ html.style.cssText = s;
y.closures = concat(cls.v, htmlCls2);
}