summaryrefslogtreecommitdiff
path: root/share/www/script/browse.js
diff options
context:
space:
mode:
authorChristopher Lenz <cmlenz@apache.org>2008-08-01 21:49:18 +0000
committerChristopher Lenz <cmlenz@apache.org>2008-08-01 21:49:18 +0000
commitdf0efb26244d27f55f2a40bffc740c127b3a50a6 (patch)
tree23e1931ba9d4f39a8bff60557c882cc7593f0e17 /share/www/script/browse.js
parent492a1d5b5268fafd9888cedf16172eabfc564d15 (diff)
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
Diffstat (limited to 'share/www/script/browse.js')
-rw-r--r--share/www/script/browse.js11
1 files changed, 5 insertions, 6 deletions
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 = $("<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 @@ 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();
});