summaryrefslogtreecommitdiffstats
path: root/client/components/boards/boardBody.js
diff options
context:
space:
mode:
authorMaxime Quandalle <maxime@quandalle.com>2015-05-29 23:35:30 +0200
committerMaxime Quandalle <maxime@quandalle.com>2015-05-30 03:50:14 +0200
commit2c0030da62b9a1e59a55e3429fe514bbd51e1ee3 (patch)
treeb2834702806e59cb05ea02e2c377266eb17d6c8f /client/components/boards/boardBody.js
parent6457615e6ac6717d2175be9483388d4d70ea1c4a (diff)
downloadwekan-2c0030da62b9a1e59a55e3429fe514bbd51e1ee3.tar.gz
wekan-2c0030da62b9a1e59a55e3429fe514bbd51e1ee3.tar.bz2
wekan-2c0030da62b9a1e59a55e3429fe514bbd51e1ee3.zip
Implement multi-selection
The UI and the internal APIs are still rough around the edges but the feature is basically working. You can now select multiple cards and move them together or (un|)assign them a label.
Diffstat (limited to 'client/components/boards/boardBody.js')
-rw-r--r--client/components/boards/boardBody.js19
1 files changed, 13 insertions, 6 deletions
diff --git a/client/components/boards/boardBody.js b/client/components/boards/boardBody.js
index cf32f764..b5e4154a 100644
--- a/client/components/boards/boardBody.js
+++ b/client/components/boards/boardBody.js
@@ -12,14 +12,16 @@ BlazeComponent.extendComponent({
return 'boardComponent';
},
+ onCreated: function() {
+ this.draggingActive = new ReactiveVar(false);
+ },
+
openNewListForm: function() {
this.componentChildren('addListForm')[0].open();
},
- showNewCardForms: function(value) {
- _.each(this.componentChildren('list'), function(listComponent) {
- listComponent.showNewCardForm(value);
- });
+ setIsDragging: function(bool) {
+ this.draggingActive.set(bool);
},
scrollLeft: function(position) {
@@ -79,8 +81,8 @@ BlazeComponent.extendComponent({
helper: 'clone',
items: '.js-list:not(.js-list-composer)',
placeholder: 'list placeholder',
- start: function(event, ui) {
- $('.list.placeholder').height(ui.item.height());
+ start: function(evt, ui) {
+ ui.placeholder.height(ui.helper.height());
Popup.close();
},
stop: function() {
@@ -97,6 +99,11 @@ BlazeComponent.extendComponent({
}
});
+ // Disable drag-dropping while in multi-selection mode
+ self.autorun(function() {
+ self.$(lists).sortable('option', 'disabled', MultiSelection.isActive());
+ });
+
// If there is no data in the board (ie, no lists) we autofocus the list
// creation form by clicking on the corresponding element.
if (self.data().lists().count() === 0) {