aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib
diff options
context:
space:
mode:
authorGravatar Adam Chlipala <adam@chlipala.net>2016-08-26 19:27:16 -0400
committerGravatar Adam Chlipala <adam@chlipala.net>2016-08-26 19:27:16 -0400
commitcd95bbc160511e06d5534cd59bbaab277c5362e2 (patch)
tree7dc7325de515427fa54db5bdbdffe7ae2ee13c5b /lib
parentf0c60c01bb078da639efd3aaf33bc2f0ff996169 (diff)
parent4330e7007078d680c1a3092d77831ed0c0fcf9b7 (diff)
Merge branch 'master' of ssh://github.com/urweb/urweb
Diffstat (limited to 'lib')
-rw-r--r--lib/js/urweb.js21
1 files changed, 14 insertions, 7 deletions
diff --git a/lib/js/urweb.js b/lib/js/urweb.js
index 68e7979d..222a8322 100644
--- a/lib/js/urweb.js
+++ b/lib/js/urweb.js
@@ -731,6 +731,8 @@ function flattenLocal(s) {
// Dynamic tree management
function populate(node) {
+ if (node.dead) return;
+
var s = node.signal;
var oldSources = node.sources;
try {
@@ -760,8 +762,7 @@ function sv(s, v) {
s.data = v;
for (var ls = s.dyns; ls; ls = ls.next)
- if (!ls.dead)
- populate(ls.data);
+ populate(ls.data);
}
}
function sg(s) {
@@ -1099,12 +1100,18 @@ function active(s) {
function input(x, s, recreate, type, name) {
if (name) x.name = name;
if (type) x.type = type;
- x.dead = false;
- x.signal = ss(s);
- x.sources = null;
- x.recreate = recreate(x);
addNode(x);
- populate(x);
+
+ var sc = document.createElement("script");
+ sc.dead = false;
+ sc.signal = ss(s);
+ sc.sources = null;
+ sc.recreate = recreate(x);
+
+ if (x.parentNode)
+ x.parentNode.insertBefore(sc, x);
+
+ populate(sc);
return x;
}