summaryrefslogtreecommitdiff
path: root/share/www/script/browse.js
diff options
context:
space:
mode:
authorChristopher Lenz <cmlenz@apache.org>2008-06-02 21:57:35 +0000
committerChristopher Lenz <cmlenz@apache.org>2008-06-02 21:57:35 +0000
commitefd28ccaa331fc983749dd6322fb4f4303c2e3b7 (patch)
tree69329772f2f0d17e31aa78fb8f08892036bb1542 /share/www/script/browse.js
parent303230cb554aa07ce7ada5520b4d3dc0bb89ec51 (diff)
* The map/reduce function textareas in Futon are now horizontally resizable split-pane style
* The initial height of the view code textareas is adjusted to the number of lines in the map/reduce functions. git-svn-id: https://svn.apache.org/repos/asf/incubator/couchdb/trunk@662587 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'share/www/script/browse.js')
-rw-r--r--share/www/script/browse.js12
1 files changed, 8 insertions, 4 deletions
diff --git a/share/www/script/browse.js b/share/www/script/browse.js
index d7e3fcee..7c6440dd 100644
--- a/share/www/script/browse.js
+++ b/share/www/script/browse.js
@@ -214,10 +214,14 @@ function CouchDatabasePage() {
}
},
success: function(resp) {
- page.storedViewCode = resp.views[localViewName];
- $("#viewcode_map").val(page.storedViewCode.map);
- $("#viewcode_reduce").val(page.storedViewCode.reduce || "");
+ var viewCode = resp.views[localViewName];
+ $("#viewcode_map").val(viewCode.map);
+ $("#viewcode_reduce").val(viewCode.reduce || "");
+ var lines = Math.max(viewCode.map.split("\n").length,
+ (viewCode.reduce ? viewCode.reduce.split("\n").length : 1));
+ $("#viewcode textarea").attr("rows", Math.min(15, Math.max(3, lines)));
$("#viewcode button.revert, #viewcode button.save").attr("disabled", "disabled");
+ page.storedViewCode = viewCode;
if (callback) callback();
}
});
@@ -744,7 +748,7 @@ function CouchDocumentPage() {
tools.appendTo(td);
input.val(prettyPrintJSON(value)).appendTo(td);
input.each(function() { this.focus(); this.select(); });
- if (needsTextarea) input.resizable();
+ if (needsTextarea) input.makeResizable({vertical: true});
}
function _initKey(doc, row, fieldName) {