summaryrefslogtreecommitdiffstats
path: root/client/lib/multiSelection.js
diff options
context:
space:
mode:
authorMaxime Quandalle <maxime@quandalle.com>2015-06-15 17:16:56 +0200
committerMaxime Quandalle <maxime@quandalle.com>2015-06-16 14:30:21 +0200
commit5478fc93dbe3be14c4a38754881e00dc0b6a38f9 (patch)
tree8b40a29a3cbe07747112e809db3fd12b719ae3bf /client/lib/multiSelection.js
parenta41e07b37ec9243191804ac2966e2d136ce79710 (diff)
downloadwekan-5478fc93dbe3be14c4a38754881e00dc0b6a38f9.tar.gz
wekan-5478fc93dbe3be14c4a38754881e00dc0b6a38f9.tar.bz2
wekan-5478fc93dbe3be14c4a38754881e00dc0b6a38f9.zip
Improve the multi-selection experience
New features: - select all filtered cards - assign or unassign a member to selected cards - archive selected cards This commit also fix the card sort indexes calculation when a multi- selection is drag-dropped.
Diffstat (limited to 'client/lib/multiSelection.js')
-rw-r--r--client/lib/multiSelection.js12
1 files changed, 9 insertions, 3 deletions
diff --git a/client/lib/multiSelection.js b/client/lib/multiSelection.js
index 2f96e199..e6db42cd 100644
--- a/client/lib/multiSelection.js
+++ b/client/lib/multiSelection.js
@@ -72,17 +72,21 @@ MultiSelection = {
return this._isActive.get();
},
+ count: function() {
+ return Cards.find(this.getMongoSelector()).count();
+ },
+
isEmpty: function() {
- return this._selectedCards.get().length === 0;
+ return this.count() === 0;
},
activate: function() {
if (! this.isActive()) {
EscapeActions.executeUpTo('detailsPane');
this._isActive.set(true);
- Sidebar.setView(this.sidebarView);
Tracker.flush();
}
+ Sidebar.setView(this.sidebarView);
},
disable: function() {
@@ -152,5 +156,7 @@ Blaze.registerHelper('MultiSelection', MultiSelection);
EscapeActions.register('multiselection',
function() { MultiSelection.disable(); },
- function() { return MultiSelection.isActive(); }
+ function() { return MultiSelection.isActive(); }, {
+ noClickEscapeOn: '.js-minicard,.js-board-sidebar-content'
+ }
);