From df0efb26244d27f55f2a40bffc740c127b3a50a6 Mon Sep 17 00:00:00 2001 From: Christopher Lenz Date: Fri, 1 Aug 2008 21:49:18 +0000 Subject: Fix collapsing of nested objects in Futon document view in Safari. git-svn-id: https://svn.apache.org/repos/asf/incubator/couchdb/trunk@681852 13f79535-47bb-0310-9956-ffa450edef68 --- share/www/script/browse.js | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'share/www') diff --git a/share/www/script/browse.js b/share/www/script/browse.js index 6cb26c49..8ef8ccfb 100644 --- a/share/www/script/browse.js +++ b/share/www/script/browse.js @@ -626,7 +626,8 @@ function CouchDocumentPage() { } function _addRowForField(doc, fieldName) { - var row = $("").find("th").append($("").text(fieldName)).end(); + var row = $("").find("th").append($("") + .text(fieldName)).end().appendTo("#fields tbody.content"); if (fieldName == "_attachments") { row .find("td").append(_renderAttachmentList(doc[fieldName])); @@ -638,15 +639,13 @@ function CouchDocumentPage() { }).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 CouchDocumentPage() { } 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(); }); -- cgit v1.2.3