summaryrefslogtreecommitdiff
path: root/lib/js/urweb.js
diff options
context:
space:
mode:
authorGravatar Adam Chlipala <adamc@hcoop.net>2009-07-19 17:45:02 -0400
committerGravatar Adam Chlipala <adamc@hcoop.net>2009-07-19 17:45:02 -0400
commit94a1373401529f500640b0c0628e7173612cdabe (patch)
tree89ce0f6149e50fdfece4b083c2be2033c7727c63 /lib/js/urweb.js
parent19cd9e965929d541e6714f62154f01b9e487a712 (diff)
Working on Grid; have gone from one dynamic table bizareness to another
Diffstat (limited to 'lib/js/urweb.js')
-rw-r--r--lib/js/urweb.js12
1 files changed, 7 insertions, 5 deletions
diff --git a/lib/js/urweb.js b/lib/js/urweb.js
index 3d4dbea2..dd66b55e 100644
--- a/lib/js/urweb.js
+++ b/lib/js/urweb.js
@@ -223,12 +223,17 @@ function lastParent() {
return pos.parentNode;
}
+function parent() {
+ return thisScript ? thisScript.parentNode : lastParent();
+}
+
function addNode(node) {
if (thisScript) {
thisScript.parentNode.appendChild(node);
thisScript.parentNode.removeChild(thisScript);
- } else
+ } else {
lastParent().appendChild(node);
+ }
}
function setHTML(html) {
@@ -266,10 +271,8 @@ function runScripts(node) {
// Dynamic tree entry points
-var dynDepth = 0;
-
function dyn(s) {
- var x = document.createElement("span");
+ var x = parent();
x.dead = false;
x.signal = s;
x.sources = null;
@@ -298,7 +301,6 @@ function dyn(s) {
x.closures = cls.v;
runScripts(x);
};
- addNode(x);
populate(x);
}