couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From robertkowal...@apache.org
Subject [1/2] fauxton commit: updated refs/heads/master to 537853e
Date Thu, 22 Oct 2015 14:23:38 GMT
Repository: couchdb-fauxton
Updated Branches:
  refs/heads/master b7dd66cea -> 537853e2f


do not check "all docs selected" if collection is loading

empty / loading collections should not display the check

PR: #564
PR-URL: https://github.com/apache/couchdb-fauxton/pull/564
Reviewed-By: Benjamin Keen <ben.keen@gmail.com>


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

Branch: refs/heads/master
Commit: 537853e2f8d63f193001b1f0693bdc9731531a99
Parents: 1252d10
Author: Robert Kowalski <robertkowalski@apache.org>
Authored: Wed Oct 21 17:40:41 2015 +0200
Committer: Robert Kowalski <robertkowalski@apache.org>
Committed: Thu Oct 22 16:23:29 2015 +0200

----------------------------------------------------------------------
 app/addons/documents/index-results/stores.js                   | 4 ++++
 .../documents/index-results/tests/index-results.storesSpec.js  | 6 ++++++
 2 files changed, 10 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/537853e2/app/addons/documents/index-results/stores.js
----------------------------------------------------------------------
diff --git a/app/addons/documents/index-results/stores.js b/app/addons/documents/index-results/stores.js
index 525cadf..18d2f06 100644
--- a/app/addons/documents/index-results/stores.js
+++ b/app/addons/documents/index-results/stores.js
@@ -356,6 +356,10 @@ function (app, FauxtonAPI, ActionTypes, HeaderActionTypes, Documents,
MangoHelpe
     },
 
     areAllDocumentsSelected: function () {
+      if (this._collection.length === 0) {
+        return false;
+      }
+
       return Object.keys(this._selectedItems).length === this._collection.length;
     },
 

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/537853e2/app/addons/documents/index-results/tests/index-results.storesSpec.js
----------------------------------------------------------------------
diff --git a/app/addons/documents/index-results/tests/index-results.storesSpec.js b/app/addons/documents/index-results/tests/index-results.storesSpec.js
index a3df44d..304cf87 100644
--- a/app/addons/documents/index-results/tests/index-results.storesSpec.js
+++ b/app/addons/documents/index-results/tests/index-results.storesSpec.js
@@ -136,6 +136,12 @@ define([
       assert.notOk(store.getHasEditableAndDeletableDoc(doclist));
     });
 
+    it('if the collection is empty, no docs should be selected', function () {
+      store._collection = new Documents.AllDocs([], opts);
+
+      assert.notOk(store.areAllDocumentsSelected());
+    });
+
   });
 
   describe('canSelectAll', function () {


Mime
View raw message