summaryrefslogtreecommitdiff
path: root/lib/js/urweb.js
diff options
context:
space:
mode:
Diffstat (limited to 'lib/js/urweb.js')
-rw-r--r--lib/js/urweb.js19
1 files changed, 17 insertions, 2 deletions
diff --git a/lib/js/urweb.js b/lib/js/urweb.js
index 84dcd7e2..57ad5454 100644
--- a/lib/js/urweb.js
+++ b/lib/js/urweb.js
@@ -302,8 +302,6 @@ function dyn(pnode, s) {
var dummy = document.createElement("body");
dummy.innerHTML = "<table>" + html + "</table>";
runScripts(dummy);
- var rows = dummy.firstChild.rows;
- var nRows = rows.length;
var table = x.parentNode;
var arr = dummy.getElementsByTagName("tbody");
@@ -317,6 +315,23 @@ function dyn(pnode, s) {
table.insertBefore(node, x);
}
}
+ } else if (pnode == "tr") {
+ var dummy = document.createElement("body");
+ dummy.innerHTML = "<table><tr>" + html + "</tr></table>";
+ runScripts(dummy);
+ var table = x.parentNode;
+
+ var arr = dummy.getElementsByTagName("tr");
+ firstChild = null;
+ if (arr.length > 0) {
+ var tbody = arr[0], next;
+ firstChild = document.createElement("script");
+ table.insertBefore(firstChild, x);
+ for (var node = tbody.firstChild; node; node = next) {
+ next = node.nextSibling;
+ table.insertBefore(node, x);
+ }
+ }
} else {
firstChild = document.createElement("span");
firstChild.innerHTML = html;