You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by de...@apache.org on 2014/08/11 21:50:29 UTC

fauxton commit: updated refs/heads/secondary-indexes to 584df27

Repository: couchdb-fauxton
Updated Branches:
  refs/heads/secondary-indexes d00cd1b08 -> 584df27b7


Hook up delete dropdown on views


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

Branch: refs/heads/secondary-indexes
Commit: 584df27b7f4be4b0889336f742452a03d59b0c7d
Parents: d00cd1b
Author: deathbearbrown <de...@gmail.com>
Authored: Mon Aug 11 15:50:37 2014 -0400
Committer: deathbearbrown <de...@gmail.com>
Committed: Mon Aug 11 15:50:37 2014 -0400

----------------------------------------------------------------------
 app/addons/indexes/routes-viewindexes.js | 6 ++++--
 app/addons/indexes/views.js              | 4 +++-
 2 files changed, 7 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/584df27b/app/addons/indexes/routes-viewindexes.js
----------------------------------------------------------------------
diff --git a/app/addons/indexes/routes-viewindexes.js b/app/addons/indexes/routes-viewindexes.js
index 7330d04..f3bb65b 100644
--- a/app/addons/indexes/routes-viewindexes.js
+++ b/app/addons/indexes/routes-viewindexes.js
@@ -88,9 +88,11 @@ function (app, FauxtonAPI, Databases, Views, Documents, Resources, RouteCore, Co
         links: [{
           title: 'Duplicate Index',
           icon: 'fonticon-documents'
-        },{
+        },
+        {
           title: 'Delete',
-          icon: 'fonticon-trash'
+          icon: 'fonticon-trash',
+          trigger: 'index:delete'
         }]
       }];
 

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/584df27b/app/addons/indexes/views.js
----------------------------------------------------------------------
diff --git a/app/addons/indexes/views.js b/app/addons/indexes/views.js
index 6340251..fa84708 100644
--- a/app/addons/indexes/views.js
+++ b/app/addons/indexes/views.js
@@ -309,6 +309,8 @@ function(app, FauxtonAPI, Components, Documents, Databases, pouchdb,
 
       this.showIndex = false;
       _.bindAll(this);
+
+      FauxtonAPI.Events.on('index:delete', this.deleteView);
     },
 
     establish: function () {
@@ -342,7 +344,7 @@ function(app, FauxtonAPI, Components, Documents, Databases, pouchdb,
     },
 
     deleteView: function (event) {
-      event.preventDefault();
+      event && event.preventDefault();
 
       if (this.newView) { return alert('Cannot delete a new view.'); }
       if (!confirm('Are you sure you want to delete this view?')) {return;}