diff options
author | Adam Chlipala <adamc@hcoop.net> | 2009-08-06 14:57:44 -0400 |
---|---|---|
committer | Adam Chlipala <adamc@hcoop.net> | 2009-08-06 14:57:44 -0400 |
commit | 38dade494489b5d093cc9bb8f7542de1324f2d55 (patch) | |
tree | ff9050728832ba4cd3278e6d80a4c9b9b90a2f01 /lib/js | |
parent | 8e40f70890e42ca4ebf9ae070712798ecdc217f0 (diff) |
<dyn> inside <tr>
Diffstat (limited to 'lib/js')
-rw-r--r-- | lib/js/urweb.js | 19 |
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; |