couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From beno...@apache.org
Subject [43/48] git commit: updated refs/heads/1960-paginate-all_dbs to ae4cae9
Date Sun, 05 Jan 2014 08:56:21 GMT
Fix for saving views


Project: http://git-wip-us.apache.org/repos/asf/couchdb/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb/commit/e4a6683d
Tree: http://git-wip-us.apache.org/repos/asf/couchdb/tree/e4a6683d
Diff: http://git-wip-us.apache.org/repos/asf/couchdb/diff/e4a6683d

Branch: refs/heads/1960-paginate-all_dbs
Commit: e4a6683d2fc6c6d51f9297d6b6068cde2cfa467c
Parents: b61105d
Author: suelockwood <deathbear@apache.org>
Authored: Sat Jan 4 16:08:37 2014 -0500
Committer: suelockwood <deathbear@apache.org>
Committed: Sat Jan 4 16:08:37 2014 -0500

----------------------------------------------------------------------
 src/fauxton/app/modules/documents/resources.js | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/e4a6683d/src/fauxton/app/modules/documents/resources.js
----------------------------------------------------------------------
diff --git a/src/fauxton/app/modules/documents/resources.js b/src/fauxton/app/modules/documents/resources.js
index 8901f5a..83589ca 100644
--- a/src/fauxton/app/modules/documents/resources.js
+++ b/src/fauxton/app/modules/documents/resources.js
@@ -96,12 +96,16 @@ function(app, FauxtonAPI) {
     setDdocView: function (view, map, reduce) {
       if (!this.isDdoc()) return false;
       var views = this.get('views');
+          tempView = views[view] || {};
+
       if (reduce) {
-        views[view].reduce=reduce;
+        tempView.reduce=reduce;
       } else {
-        delete views[view].reduce;
+        delete tempView.reduce;
       }
-      views[view].map= map;
+      tempView.map= map;
+
+      views[view] = tempView;
       this.set({views: views});
 
       return true;


Mime
View raw message