couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From deathb...@apache.org
Subject fauxton commit: updated refs/heads/secondary-indexes to 2a7b1fa
Date Mon, 11 Aug 2014 19:11:11 GMT
Repository: couchdb-fauxton
Updated Branches:
  refs/heads/secondary-indexes f7081e448 -> 2a7b1fafb


Trigger event to go back to prev header on Bulk Delete


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

Branch: refs/heads/secondary-indexes
Commit: 2a7b1fafba931eaab03faf3464c261a58f155c9a
Parents: f7081e4
Author: deathbearbrown <deathbearbrown@gmail.com>
Authored: Mon Aug 11 15:11:17 2014 -0400
Committer: deathbearbrown <deathbearbrown@gmail.com>
Committed: Mon Aug 11 15:11:17 2014 -0400

----------------------------------------------------------------------
 app/addons/documents/resources.js               |  2 +-
 .../documents/templates/all_docs_item.html      |  8 ++--
 app/addons/documents/views.js                   | 40 ++++++++++----------
 3 files changed, 25 insertions(+), 25 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/2a7b1faf/app/addons/documents/resources.js
----------------------------------------------------------------------
diff --git a/app/addons/documents/resources.js b/app/addons/documents/resources.js
index d953dd1..219bf2d 100644
--- a/app/addons/documents/resources.js
+++ b/app/addons/documents/resources.js
@@ -359,7 +359,7 @@ function(app, FauxtonAPI, PagingCollection) {
       if (ids.errorIds.length) {
         this.trigger('error', ids.errorIds);
       }
-
+      FauxtonAPI.Events.trigger('success:bulkDelete');
       this.trigger('updated');
     },
 

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/2a7b1faf/app/addons/documents/templates/all_docs_item.html
----------------------------------------------------------------------
diff --git a/app/addons/documents/templates/all_docs_item.html b/app/addons/documents/templates/all_docs_item.html
index 80dbfe9..783e4f5 100644
--- a/app/addons/documents/templates/all_docs_item.html
+++ b/app/addons/documents/templates/all_docs_item.html
@@ -25,10 +25,8 @@ the License.
     </div>
   <% } %>
   </header>
-  <% if (expanded){ %>
-    <div class="doc-data">
-      <pre class="prettyprint"><%- doc.prettyJSON() %></pre>
-    </div>
-  <% } %>
+  <div class="doc-data">
+    <pre class="prettyprint"><%- doc.prettyJSON() %></pre>
+  </div>
 </div>
 <div class="clearfix"></div>

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/2a7b1faf/app/addons/documents/views.js
----------------------------------------------------------------------
diff --git a/app/addons/documents/views.js b/app/addons/documents/views.js
index 31438df..9813b23 100644
--- a/app/addons/documents/views.js
+++ b/app/addons/documents/views.js
@@ -43,7 +43,7 @@ function(app, FauxtonAPI, Components, Documents, Databases, Views, QueryOptions,
     className: "header-right",
     template: "addons/documents/templates/header_alldocs",
     events: {
-      'click .toggle-select-menu': 'selectAllDocs'
+      'click .toggle-select-menu': 'selectAllMenu'
     },
 
     initialize: function(options){
@@ -52,9 +52,10 @@ function(app, FauxtonAPI, Components, Documents, Databases, Views, QueryOptions,
       _.bindAll(this);
       this.selectVisible = false;
       FauxtonAPI.Events.on('advancedOptions:updateView', this.updateAllDocs);
+      FauxtonAPI.Events.on('success:bulkDelete', this.selectAllMenu);
     },
 
-    selectAllDocs: function(e){
+    selectAllMenu: function(e){
       //trigger event to select all in other view
       this.$('.toggle-select-menu').toggleClass('active');
 
@@ -202,7 +203,10 @@ function(app, FauxtonAPI, Components, Documents, Databases, Views, QueryOptions,
 
       FauxtonAPI.Events.trigger("documents:selectAll", this.$(evt.target).hasClass('active'));
     },
-    collapse: function(){
+    collapse: function(evt){
+      var icon = this.$(evt.target).find('i');
+      icon.toggleClass('icon-minus');
+      icon.toggleClass('icon-plus');
       FauxtonAPI.Events.trigger("documents:collapse");
     }
   });
@@ -259,11 +263,24 @@ function(app, FauxtonAPI, Components, Documents, Databases, Views, QueryOptions,
       this.showSelect = false;
       _.bindAll(this);
       FauxtonAPI.Events.on("documents:show-select-all", this.showSelectBox);
+      FauxtonAPI.Events.on("documents:collapse", this.collapse);
+      FauxtonAPI.Events.on("documents:selectAll", this.selectAll);
     },
+
     showSelectBox: function(bool){
       this.showSelect = bool;
       this.$('.select').toggle(this.showSelect);
     },
+
+    selectAll: function(checked){
+      this.$("input:checkbox").prop('checked', checked).trigger('click');
+    },
+
+    collapse: function(bool){
+      this.collapse = bool;
+      this.$('.doc-data').toggle(this.collapse);
+    },
+
     events: {
       "click button.delete": "destroy",
       "dblclick pre.prettyprint": "edit"
@@ -419,8 +436,7 @@ function(app, FauxtonAPI, Components, Documents, Databases, Views, QueryOptions,
       }
 
       FauxtonAPI.Events.on("documents:bulkDelete", this.bulkDelete);
-      FauxtonAPI.Events.on("documents:selectAll", this.selectAll);
-      FauxtonAPI.Events.on("documents:collapse", this.collapse);
+      FauxtonAPI.Events.on("documents:selectAll", this.toggleTrash);
     },
 
     removeDocuments: function (ids) {
@@ -507,10 +523,6 @@ function(app, FauxtonAPI, Components, Documents, Databases, Views, QueryOptions,
       });
     },
 
-    selectAll: function(checked){
-      this.$el.find("input:checkbox").prop('checked', checked).trigger('click');
-    },
-
     serialize: function() {
       return {
         viewList: this.viewList,
@@ -519,16 +531,6 @@ function(app, FauxtonAPI, Components, Documents, Databases, Views, QueryOptions,
       };
     },
 
-    collapse: function (event) {
-      if (this.expandDocs) {
-        this.expandDocs = false;
-      } else {
-        this.expandDocs = true;
-      }
-
-      this.render();
-    },
-
     bulkDelete: function() {
       var that = this,
           documentsLength = this.bulkDeleteDocsCollection.length,


Mime
View raw message