changeset 900:ed381288ce9a

Tweaking dyn() implementation to get grid working
author Adam Chlipala <adamc@hcoop.net>
date Thu, 06 Aug 2009 11:58:38 -0400
parents 25a038a9194b
children f17638dd3080
files lib/js/urweb.js
diffstat 1 files changed, 4 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/lib/js/urweb.js	Thu Aug 06 11:54:28 2009 -0400
+++ b/lib/js/urweb.js	Thu Aug 06 11:58:38 2009 -0400
@@ -291,7 +291,8 @@
 
       var old = node;
       node = node.nextSibling;
-      old.parentNode.removeChild(old);
+      if (old.parentNode)
+        old.parentNode.removeChild(old);
     }
 
     var cls = {v : null};
@@ -304,7 +305,8 @@
     for (var node = first; node; ) {
       var old = node;
       node = node.nextSibling;
-      x.parentNode.insertBefore(old, x);
+      if (x.parentNode)
+        x.parentNode.insertBefore(old, x);
     }
   };