diff options
author | Christopher Lenz <cmlenz@apache.org> | 2008-05-23 12:52:23 +0000 |
---|---|---|
committer | Christopher Lenz <cmlenz@apache.org> | 2008-05-23 12:52:23 +0000 |
commit | 56fb317a9c095ca5fa866a2811774d6805ce723b (patch) | |
tree | bc7f6e64be870e2277e1060dbf99fc2970912396 /share | |
parent | 51fbc48aedac2e3db1af3126f646092ca5ce5a8b (diff) |
Fixes for map/reduce support in Futon.
git-svn-id: https://svn.apache.org/repos/asf/incubator/couchdb/trunk@659522 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'share')
-rw-r--r-- | share/www/script/browse.js | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/share/www/script/browse.js b/share/www/script/browse.js index 1a5dcd93..01a69050 100644 --- a/share/www/script/browse.js +++ b/share/www/script/browse.js @@ -359,7 +359,7 @@ function CouchDatabasePage() { $("#documents tbody.content").empty(); this.updateDesignDocLink(); - function handleResults(resp) { + options.success = function(resp) { if (resp.offset === undefined) { resp.offset = 0; } @@ -426,10 +426,8 @@ function CouchDatabasePage() { $("#documents").addClass("reduced"); } $("#documents tbody tr:odd").addClass("odd"); - $(document.body).removeClass("loading"); } - options.success = handleResults; options.error = function(status, error, reason) { alert("Error: " + error + "\n\n" + reason); $(document.body).removeClass("loading"); @@ -444,6 +442,7 @@ function CouchDatabasePage() { var mapFun = $("#viewcode_map").val(); $.cookies.set(db.name + ".map", mapFun); var reduceFun = $("#viewcode_reduce").val() || null; + window.console.log(reduceFun); if (reduceFun != null) { $.cookies.set(db.name + ".reduce", reduceFun); } else { @@ -456,9 +455,10 @@ function CouchDatabasePage() { db.allDocs(options); } else { $("#viewcode").show(); - var currentViewCode = $("#viewcode_map").val(); + var currentMapCode = $("#viewcode_map").val(); + var currentReduceCode = $("#viewcode_reduce").val() || null; if (page.isDirty) { - db.query(currentViewCode, options); + db.query(currentMapCode, currentReduceCode, null, options); } else { db.view(viewName.substr(8), options); } |