summaryrefslogtreecommitdiff
path: root/share/www/script/futon.browse.js
diff options
context:
space:
mode:
Diffstat (limited to 'share/www/script/futon.browse.js')
-rw-r--r--share/www/script/futon.browse.js6
1 files changed, 3 insertions, 3 deletions
diff --git a/share/www/script/futon.browse.js b/share/www/script/futon.browse.js
index 4cb3eb6a..e6875948 100644
--- a/share/www/script/futon.browse.js
+++ b/share/www/script/futon.browse.js
@@ -602,8 +602,8 @@
$("#viewcode").show().removeClass("collapsed");
var mapFun = $("#viewcode_map").val();
$.cookies.set(db.name + ".map", mapFun);
- var reduceFun = $("#viewcode_reduce").val() || null;
- if (reduceFun != null) {
+ var reduceFun = $.trim($("#viewcode_reduce").val()) || null;
+ if (reduceFun) {
$.cookies.set(db.name + ".reduce", reduceFun);
options.group = true;
} else {
@@ -618,7 +618,7 @@
} else {
$("#viewcode").show();
var currentMapCode = $("#viewcode_map").val();
- var currentReduceCode = $("#viewcode_reduce").val() || null;
+ var currentReduceCode = $.trim($("#viewcode_reduce").val()) || null;
if (currentReduceCode) {
options.group = true;
}