couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cml...@apache.org
Subject svn commit: r734955 - /couchdb/trunk/share/www/script/futon.browse.js
Date Fri, 16 Jan 2009 10:08:48 GMT
Author: cmlenz
Date: Fri Jan 16 02:08:46 2009
New Revision: 734955

URL: http://svn.apache.org/viewvc?rev=734955&view=rev
Log:
In the Futon document view, delete the whole _attachments row when the only/last attachment
is removed.

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

Modified: couchdb/trunk/share/www/script/futon.browse.js
URL: http://svn.apache.org/viewvc/couchdb/trunk/share/www/script/futon.browse.js?rev=734955&r1=734954&r2=734955&view=diff
==============================================================================
--- couchdb/trunk/share/www/script/futon.browse.js [utf-8] (original)
+++ couchdb/trunk/share/www/script/futon.browse.js [utf-8] Fri Jan 16 02:08:46 2009
@@ -950,8 +950,14 @@
 
       function _initAttachmentItem(name, attachment, li) {
         $("<button type='button' class='delete' title='Delete attachment'></button>").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));



Mime
View raw message