couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dav...@apache.org
Subject [27/52] [abbrv] fauxton commit: updated refs/heads/import-master to d11b90b
Date Wed, 12 Feb 2014 06:20:21 GMT
Fauxton: Fix rename view shows in sidebar


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

Branch: refs/heads/import-master
Commit: 04808692cc5297210cbdc53493ffd2fee7ed13a3
Parents: 8fda790
Author: Garren Smith <garren.smith@gmail.com>
Authored: Tue Jan 21 15:30:46 2014 +0200
Committer: Garren Smith <garren.smith@gmail.com>
Committed: Tue Jan 21 15:30:46 2014 +0200

----------------------------------------------------------------------
 app/addons/compaction/views.js |  1 -
 app/addons/documents/views.js  | 13 ++++++++-----
 2 files changed, 8 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/04808692/app/addons/compaction/views.js
----------------------------------------------------------------------
diff --git a/app/addons/compaction/views.js b/app/addons/compaction/views.js
index 06a1300..f5469cf 100644
--- a/app/addons/compaction/views.js
+++ b/app/addons/compaction/views.js
@@ -52,7 +52,6 @@ function (app, FauxtonAPI, Compaction) {
           msg: 'Database compaction has started. Visit <a href="#activetasks">Active
Tasks</a> to view the compaction progress.',
         });
       }, function (xhr, error, reason) {
-        console.log(arguments);
         FauxtonAPI.addNotification({
           type: 'error',
           msg: 'Error: ' + JSON.parse(xhr.responseText).reason

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/04808692/app/addons/documents/views.js
----------------------------------------------------------------------
diff --git a/app/addons/documents/views.js b/app/addons/documents/views.js
index ba7e7d7..d5319f3 100644
--- a/app/addons/documents/views.js
+++ b/app/addons/documents/views.js
@@ -1344,9 +1344,14 @@ function(app, FauxtonAPI, Components, Documents, Databases, pouchdb,
resizeColum
         reduceVal = this.reduceVal(),
         viewName = this.$('#index-name').val(),
         ddoc = this.getCurrentDesignDoc(),
-        ddocName = ddoc.id;
+        ddocName = ddoc.id,
+        viewNameChange = false;
 
-        this.viewName = viewName;
+        if (this.viewName !== viewName) {
+          ddoc.removeDdocView(this.viewName);
+          this.viewName = viewName;
+          viewNameChange = true;
+        }
 
         notification = FauxtonAPI.addNotification({
           msg: "Saving document.",
@@ -1369,7 +1374,7 @@ function(app, FauxtonAPI, Components, Documents, Databases, pouchdb,
resizeColum
             clear: true
           });
 
-          if (that.newView) {
+          if (that.newView || viewNameChange) {
             var fragment = '/database/' + that.database.safeID() +'/' + ddoc.safeID() + '/_view/'
+ app.utils.safeURLName(viewName); 
 
             FauxtonAPI.navigate(fragment, {trigger: false});
@@ -1485,8 +1490,6 @@ function(app, FauxtonAPI, Components, Documents, Databases, pouchdb,
resizeColum
 
       promise.then(function () {
         params.docs = that.database.allDocs.map(function (model) { return model.get('doc');});

-
-        console.log('p', params, paramsInfo);
         var queryPromise = pouchdb.runViewQuery({map: mapVal, reduce: reduceVal}, params);
         queryPromise.then(function (results) {
           FauxtonAPI.triggerRouteEvent('updatePreviewDocs', {rows: results.rows, ddoc: that.getCurrentDesignDoc().id,
view: that.viewName});


Mime
View raw message