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 2009/01/26 21:52:43 UTC

svn commit: r737834 - in /couchdb/trunk/share/www/script: futon.browse.js jquery.editinline.js

Author: cmlenz
Date: Mon Jan 26 20:52:43 2009
New Revision: 737834

URL: http://svn.apache.org/viewvc?rev=737834&view=rev
Log:
Fix expanding/collapsing nested structures in Futon, as well as expanding/collapsing after cancelling an in-place edit.

Modified:
    couchdb/trunk/share/www/script/futon.browse.js
    couchdb/trunk/share/www/script/jquery.editinline.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=737834&r1=737833&r2=737834&view=diff
==============================================================================
--- couchdb/trunk/share/www/script/futon.browse.js [utf-8] (original)
+++ couchdb/trunk/share/www/script/futon.browse.js [utf-8] Mon Jan 26 20:52:43 2009
@@ -866,6 +866,10 @@
             }
             return $("<input type='text' spellcheck='false'>");
           },
+          end: function() {
+            $(this).children().remove();
+            $(this).append(_renderValue(doc[row.data("name")]));
+          },
           prepareInput: function(input) {
             if ($(input).is("textarea")) {
               $(input).makeResizable({vertical: true});
@@ -873,10 +877,7 @@
           },
           accept: function(newValue) {
             doc[row.data("name")] = JSON.parse(newValue);
-            $(this).children().remove();
             page.isDirty = true;
-            var value = _renderValue(doc[row.data("name")]);
-            $(this).append(value);
           },
           populate: function(value) {
             return $.futon.formatJSON(doc[row.data("name")]);
@@ -904,7 +905,7 @@
             var list = $("<dl></dl>");
             for (var i in val) {
               $("<dt></dt>").text(i).appendTo(list);
-              $("<dd></dd>").append(_renderValue(val[i])).appendTo(list);
+              $("<dd></dd>").append(render(val[i])).appendTo(list);
             }
             return list;
           } else {

Modified: couchdb/trunk/share/www/script/jquery.editinline.js
URL: http://svn.apache.org/viewvc/couchdb/trunk/share/www/script/jquery.editinline.js?rev=737834&r1=737833&r2=737834&view=diff
==============================================================================
--- couchdb/trunk/share/www/script/jquery.editinline.js (original)
+++ couchdb/trunk/share/www/script/jquery.editinline.js Mon Jan 26 20:52:43 2009
@@ -57,7 +57,7 @@
       input.remove();
       tools.remove();
       options.accept.apply(elem, [newText, origText]);
-      editable.removeClass("editinline-container")
+      editable.removeClass("editinline-container");
       options.end.apply(elem, [keyCode]);
       return true;
     }