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.
This commit is contained in:
Maxime Quandalle 2015-06-15 17:16:56 +02:00
parent a41e07b37e
commit 5478fc93db
12 changed files with 146 additions and 53 deletions

View file

@ -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'
}
);