You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by cm...@apache.org on 2008/08/01 23:49:19 UTC

svn commit: r681852 - /incubator/couchdb/trunk/share/www/script/browse.js

Author: cmlenz
Date: Fri Aug  1 14:49:18 2008
New Revision: 681852

URL: http://svn.apache.org/viewvc?rev=681852&view=rev
Log:
Fix collapsing of nested objects in Futon document view in Safari.

Modified:
    incubator/couchdb/trunk/share/www/script/browse.js

Modified: incubator/couchdb/trunk/share/www/script/browse.js
URL: http://svn.apache.org/viewvc/incubator/couchdb/trunk/share/www/script/browse.js?rev=681852&r1=681851&r2=681852&view=diff
==============================================================================
--- incubator/couchdb/trunk/share/www/script/browse.js [utf-8] (original)
+++ incubator/couchdb/trunk/share/www/script/browse.js [utf-8] Fri Aug  1 14:49:18 2008
@@ -626,7 +626,8 @@
   }
 
   function _addRowForField(doc, fieldName) {
-    var row = $("<tr><th></th><td></td></tr>").find("th").append($("<b></b>").text(fieldName)).end();
+    var row = $("<tr><th></th><td></td></tr>").find("th").append($("<b></b>")
+      .text(fieldName)).end().appendTo("#fields tbody.content");
     if (fieldName == "_attachments") {
       row
         .find("td").append(_renderAttachmentList(doc[fieldName]));
@@ -638,15 +639,13 @@
         }).end()
         .find("td").append(value).dblclick(function() {
           _editValue(doc, this, $(this).prev("th").text());
-        }).end()
-        
+        }).end();
       if (fieldName != "_id" && fieldName != "_rev") {
         row.find("th, td").attr("title", "Double click to edit");
         _initKey(doc, row, fieldName);
         _initValue(value);
       }
     }
-    row.appendTo("#fields tbody.content");
     $("#fields tbody tr").removeClass("odd").filter(":odd").addClass("odd");
     return row;
   }
@@ -766,8 +765,8 @@
   }
 
   function _initValue(value) {
-    value.find("dd").filter(":has(dl)").hide().prev("dt").addClass("collapsed");
-    value.find("dd").not(":has(dl)").addClass("inline").prev().addClass("inline");
+    value.find("dd:has(dl)").hide().prev("dt").addClass("collapsed");
+    value.find("dd:not(:has(dl))").addClass("inline").prev().addClass("inline");
     value.find("dt.collapsed").click(function() {
       $(this).toggleClass("collapsed").next().toggle();
     });