summaryrefslogtreecommitdiff
path: root/share/www/script/futon.browse.js
diff options
context:
space:
mode:
authorChristopher Lenz <cmlenz@apache.org>2009-12-11 22:39:29 +0000
committerChristopher Lenz <cmlenz@apache.org>2009-12-11 22:39:29 +0000
commitf51ffa07b3faf0c1e1984b2853e4c8af36ae3289 (patch)
tree44cab2fb667839abe7643f56d34fc3c705cd6651 /share/www/script/futon.browse.js
parentfc27e23f3cc57159b1ee91747591cb0496385489 (diff)
Futon: A couple of bug fixes:
* Enable tab insertion in text areas for temp views. * Properly sync disabled status of "grouping" control on page load. git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@889841 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'share/www/script/futon.browse.js')
-rw-r--r--share/www/script/futon.browse.js13
1 files changed, 6 insertions, 7 deletions
diff --git a/share/www/script/futon.browse.js b/share/www/script/futon.browse.js
index 9faf7669..733c9d08 100644
--- a/share/www/script/futon.browse.js
+++ b/share/www/script/futon.browse.js
@@ -101,8 +101,8 @@
$.futon.storage.declareWithPrefix(dbName + ".", {
desc: {},
language: {defaultValue: "javascript"},
- map_fun: {},
- reduce_fun: {},
+ map_fun: {defaultValue: ""},
+ reduce_fun: {defaultValue: ""},
reduce: {},
group_level: {defaultValue: 100},
per_page: {defaultValue: 10},
@@ -197,6 +197,7 @@
map: $("#viewcode_map").val(),
reduce: $("#viewcode_reduce").val()
};
+ $("#reduce, #grouplevel").toggle(!!viewCode.reduce);
page.isDirty = (viewCode.map != page.storedViewCode.map)
|| (viewCode.reduce != (page.storedViewCode.reduce || ""))
|| page.viewLanguage != page.storedViewLanguage;
@@ -205,7 +206,6 @@
} else {
buttons.attr("disabled", "disabled");
}
- $("#reduce, #grouplevel").toggle(!!viewCode.reduce);
}, 100);
}
$("#viewcode textarea").enableTabInsertion()
@@ -222,10 +222,11 @@
page.updateDocumentListing();
});
} else if (viewName == "_temp_view") {
+ $("#viewcode textarea").enableTabInsertion();
page.viewLanguage = $.futon.storage.get("language");
page.updateViewEditor(
- $.futon.storage.get("map", templates[page.viewLanguage]),
- $.futon.storage.get("reduce")
+ $.futon.storage.get("map_fun", templates[page.viewLanguage]),
+ $.futon.storage.get("reduce_fun")
);
} else {
$("#grouplevel, #reduce").hide();
@@ -671,8 +672,6 @@
} else {
options.reduce = false;
}
- } else {
- $.futon.storage.del("reduce");
}
$.futon.storage.set("language", page.viewLanguage);
db.query(mapFun, reduceFun, page.viewLanguage, options);