summaryrefslogtreecommitdiff
path: root/share/www/script/futon.browse.js
diff options
context:
space:
mode:
authorChristopher Lenz <cmlenz@apache.org>2010-03-04 21:46:55 +0000
committerChristopher Lenz <cmlenz@apache.org>2010-03-04 21:46:55 +0000
commitc91a533e432a3297dfc67049338c97f6c53daba6 (patch)
tree1f713ab3c64987535a34c8410fa485a3949f5ab5 /share/www/script/futon.browse.js
parentb1ead98c905e60ed07de0592122642c018eb525b (diff)
Futon: use proper document value when constructing input element for inline editing, instead of its HTML rendering, and always create textarea for multiline strings. Closes COUCHDB-671.
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@919193 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'share/www/script/futon.browse.js')
-rw-r--r--share/www/script/futon.browse.js3
1 files changed, 2 insertions, 1 deletions
diff --git a/share/www/script/futon.browse.js b/share/www/script/futon.browse.js
index 408d34cc..924372cf 100644
--- a/share/www/script/futon.browse.js
+++ b/share/www/script/futon.browse.js
@@ -1095,10 +1095,11 @@
row.find("td").makeEditable({acceptOnBlur: false, allowEmpty: true,
createInput: function(value) {
+ value = doc[row.data("name")];
var elem = $(this);
if (elem.find("dl").length > 0 ||
elem.find("code").is(".array, .object") ||
- elem.find("code.string").text().length > 60) {
+ typeof(value) == "string" && (value.length > 60 || value.match(/\n/))) {
return $("<textarea rows='1' cols='40' spellcheck='false'></textarea>");
}
return $("<input type='text' spellcheck='false'>");