From 19a1c58f04cef79e188ac603e5dbdd5d284d48e0 Mon Sep 17 00:00:00 2001 From: Christopher Lenz Date: Fri, 16 Jan 2009 10:08:46 +0000 Subject: In the Futon document view, delete the whole _attachments row when the only/last attachment is removed. git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@734955 13f79535-47bb-0310-9956-ffa450edef68 --- share/www/script/futon.browse.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'share') diff --git a/share/www/script/futon.browse.js b/share/www/script/futon.browse.js index d13724ea..cdd3a41e 100644 --- a/share/www/script/futon.browse.js +++ b/share/www/script/futon.browse.js @@ -950,8 +950,14 @@ function _initAttachmentItem(name, attachment, li) { $("").click(function() { - delete page.doc._attachments[name]; - li.remove(); + if (!li.siblings("li").length) { + delete page.doc._attachments; + li.parents("tr").remove(); + $("#fields tbody.content tr").removeClass("odd").filter(":odd").addClass("odd"); + } else { + delete page.doc._attachments[name]; + li.remove(); + } page.isDirty = true; return false; }).prependTo($("a", li)); -- cgit v1.2.3