From 36e519fc8d2a406071173d4eda8bf0a64ce2968d Mon Sep 17 00:00:00 2001 From: Christopher Lenz Date: Mon, 26 Jan 2009 20:52:43 +0000 Subject: Fix expanding/collapsing nested structures in Futon, as well as expanding/collapsing after cancelling an in-place edit. git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@737834 13f79535-47bb-0310-9956-ffa450edef68 --- share/www/script/futon.browse.js | 9 +++++---- share/www/script/jquery.editinline.js | 2 +- 2 files changed, 6 insertions(+), 5 deletions(-) (limited to 'share') diff --git a/share/www/script/futon.browse.js b/share/www/script/futon.browse.js index cff08c8c..6f90b5a8 100644 --- a/share/www/script/futon.browse.js +++ b/share/www/script/futon.browse.js @@ -866,6 +866,10 @@ } return $(""); }, + 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 = $("
"); for (var i in val) { $("
").text(i).appendTo(list); - $("
").append(_renderValue(val[i])).appendTo(list); + $("
").append(render(val[i])).appendTo(list); } return list; } else { diff --git a/share/www/script/jquery.editinline.js b/share/www/script/jquery.editinline.js index 3f1f85e3..e97abe1d 100644 --- a/share/www/script/jquery.editinline.js +++ b/share/www/script/jquery.editinline.js @@ -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; } -- cgit v1.2.3