You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by ga...@apache.org on 2014/09/23 15:07:48 UTC

[2/2] fauxton commit: updated refs/heads/master to 1ace060

fix delete database regression


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

Branch: refs/heads/master
Commit: 3556bf788ffdeadb914f33774d73e5aabe17e55a
Parents: 92aa987
Author: Garren Smith <ga...@gmail.com>
Authored: Tue Sep 23 11:44:05 2014 +0200
Committer: Garren Smith <ga...@gmail.com>
Committed: Tue Sep 23 15:07:24 2014 +0200

----------------------------------------------------------------------
 app/addons/documents/routes-documents.js |  3 +--
 app/addons/documents/views-sidebar.js    |  6 ------
 app/addons/documents/views.js            | 13 +++++++++++++
 3 files changed, 14 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/3556bf78/app/addons/documents/routes-documents.js
----------------------------------------------------------------------
diff --git a/app/addons/documents/routes-documents.js b/app/addons/documents/routes-documents.js
index d811d0e..876535e 100644
--- a/app/addons/documents/routes-documents.js
+++ b/app/addons/documents/routes-documents.js
@@ -120,7 +120,6 @@ function(app, FauxtonAPI, Documents, Changes, Index, DocEditor, Databases, Resou
         collection: this.designDocs,
         database: this.database
       }));
-
     },
 
     setUpDropdown: function(){
@@ -488,7 +487,7 @@ function(app, FauxtonAPI, Documents, Changes, Index, DocEditor, Databases, Resou
       this.changesView.filters.splice(this.changesView.filters.indexOf(filter), 1);
       this.changesView.render();
       this.leftheader.forceRender();
-    },
+    }
 
   });
 

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/3556bf78/app/addons/documents/views-sidebar.js
----------------------------------------------------------------------
diff --git a/app/addons/documents/views-sidebar.js b/app/addons/documents/views-sidebar.js
index 34212ef..e3eaeda 100644
--- a/app/addons/documents/views-sidebar.js
+++ b/app/addons/documents/views-sidebar.js
@@ -27,9 +27,6 @@ function(app, FauxtonAPI, Components, Documents, Databases) {
     template: "addons/documents/templates/sidebar",
     className: "sidenav",
     tagName: "nav",
-    events: {
-      "click button#delete-database": "showDeleteDatabaseModal"
-    },
 
     initialize: function(options) {
       this.database = options.database;
@@ -40,9 +37,6 @@ function(app, FauxtonAPI, Components, Documents, Databases) {
 
       this.designDocList = [];
     },
-    showDeleteDatabaseModal: function(event){
-      this.deleteDBModal.showModal();
-    },
 
     serialize: function() {
       var docLinks = FauxtonAPI.getExtensions('docLinks'),

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/3556bf78/app/addons/documents/views.js
----------------------------------------------------------------------
diff --git a/app/addons/documents/views.js b/app/addons/documents/views.js
index bda8256..e9a13d1 100644
--- a/app/addons/documents/views.js
+++ b/app/addons/documents/views.js
@@ -159,6 +159,18 @@ function(app, FauxtonAPI, Components, Documents, Databases, Views, QueryOptions,
 
   Views.DeleteDBModal = Components.ModalView.extend({
     template: "addons/documents/templates/delete_database_modal",
+    initialize: function (options) {
+      this.database = options.database;
+      FauxtonAPI.Events.on('database:delete', this.showDeleteDatabase, this);
+    },
+
+    showDeleteDatabase: function () {
+      this.showModal();
+    },
+
+    cleanup: function () {
+      FauxtonAPI.Events.off('database:delete', this.showDeleteDatabase);
+    },
 
     events: {
       "click #delete-db-btn": "deleteDatabase",
@@ -167,6 +179,7 @@ function(app, FauxtonAPI, Components, Documents, Databases, Views, QueryOptions,
 
     deleteDatabase: function (event) {
       event.preventDefault();
+
       var enterredName = this.$('#db_name')[0].value;
       if (this.database.id != enterredName) {
         this.set_error_msg(enterredName + " does not match database id - are you sure you want to delete " + this.database.id + "?");