changeset 945:7710f65935b6

Filters displaying awfully
author Adam Chlipala <adamc@hcoop.net>
date Tue, 15 Sep 2009 16:06:12 -0400 (2009-09-15)
parents da3ec6014d2f
children 2412cb10c97c
files lib/js/urweb.js
diffstat 1 files changed, 12 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/lib/js/urweb.js	Tue Sep 15 15:48:53 2009 -0400
+++ b/lib/js/urweb.js	Tue Sep 15 16:06:12 2009 -0400
@@ -306,14 +306,18 @@
 
       var arr = dummy.getElementsByTagName("tbody");
       firstChild = null;
-      if (arr.length > 0 && table != null) {
-        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);
-        }
+      var tbody;
+      if (arr.length > 0 && table != null)
+        tbody = arr[0];
+      else
+        tbody = dummy;
+
+      var 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 if (pnode == "tr") {
       var dummy = document.createElement("body");