From 2c0030da62b9a1e59a55e3429fe514bbd51e1ee3 Mon Sep 17 00:00:00 2001 From: Maxime Quandalle Date: Fri, 29 May 2015 23:35:30 +0200 Subject: 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. --- client/components/lists/body.js | 23 +++++++---------------- 1 file changed, 7 insertions(+), 16 deletions(-) (limited to 'client/components/lists/body.js') diff --git a/client/components/lists/body.js b/client/components/lists/body.js index 8400af96..04f122cb 100644 --- a/client/components/lists/body.js +++ b/client/components/lists/body.js @@ -34,18 +34,17 @@ BlazeComponent.extendComponent({ } if ($.trim(title)) { - Cards.insert({ + var _id = Cards.insert({ title: title, listId: this.data()._id, boardId: this.data().board()._id, sort: sortIndex - }, function(err, _id) { - // In case the filter is active we need to add the newly inserted card - // in the list of exceptions -- cards that are not filtered. Otherwise - // the card will disappear instantly. - // See https://github.com/libreboard/libreboard/issues/80 - Filter.addException(_id); }); + // In case the filter is active we need to add the newly inserted card in + // the list of exceptions -- cards that are not filtered. Otherwise the + // card will disappear instantly. + // See https://github.com/libreboard/libreboard/issues/80 + Filter.addException(_id); // We keep the form opened, empty it, and scroll to it. textarea.val('').focus(); @@ -55,10 +54,6 @@ BlazeComponent.extendComponent({ } }, - showNewCardForm: function(value) { - this.newCardFormIsVisible.set(value); - }, - scrollToBottom: function() { var container = this.firstNode(); $(container).animate({ @@ -66,14 +61,10 @@ BlazeComponent.extendComponent({ }); }, - onCreated: function() { - this.newCardFormIsVisible = new ReactiveVar(true); - }, - events: function() { return [{ submit: this.addCard, - 'click .open-card-composer': this.scrollToBottom + 'click .open-minicard-composer': this.scrollToBottom }]; } }).register('listBody'); -- cgit v1.2.3-1-g7c22