diff options
author | Ghassen Rjab <rjab.ghassen@gmail.com> | 2017-11-14 03:03:08 +0100 |
---|---|---|
committer | Ghassen Rjab <rjab.ghassen@gmail.com> | 2017-11-14 03:03:08 +0100 |
commit | 59f4daf91eedd0d5c4ff0ed3f271da8259c2ca9f (patch) | |
tree | a33a92d59412c3f8fa9b19ed21f6335ff6b3dd25 /client/components/cards/cardDetails.js | |
parent | ba3c3f8289534fed7b1525821fbf0d2fd3bd5ec2 (diff) | |
download | wekan-59f4daf91eedd0d5c4ff0ed3f271da8259c2ca9f.tar.gz wekan-59f4daf91eedd0d5c4ff0ed3f271da8259c2ca9f.tar.bz2 wekan-59f4daf91eedd0d5c4ff0ed3f271da8259c2ca9f.zip |
Copy cards cross boards
Diffstat (limited to 'client/components/cards/cardDetails.js')
-rw-r--r-- | client/components/cards/cardDetails.js | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/client/components/cards/cardDetails.js b/client/components/cards/cardDetails.js index 836a2353..14efca7e 100644 --- a/client/components/cards/cardDetails.js +++ b/client/components/cards/cardDetails.js @@ -214,12 +214,43 @@ Template.moveCardPopup.events({ }, }); +BlazeComponent.extendComponent({ + onCreated() { + this.selectedBoard = new ReactiveVar(Session.get('currentBoard')); + }, + + boards() { + const boards = Boards.find({ + archived: false, + 'members.userId': Meteor.userId(), + }, { + sort: ['title'], + }); + return boards; + }, + + aBoardLists() { + const board = Boards.findOne(this.selectedBoard.get()); + return board.lists(); + }, + + events() { + return [{ + 'change .js-select-boards' (evt) { + this.selectedBoard.set($(evt.currentTarget).val()); + }, + }]; + }, +}).register('boardsAndLists'); + Template.copyCardPopup.events({ 'click .js-select-list' (evt) { const card = Cards.findOne(Session.get('currentCard')); const oldId = card._id; card._id = null; card.listId = this._id; + const list = Lists.findOne(card.listId); + card.boardId = list.boardId; const textarea = $(evt.currentTarget).parents('.content').find('textarea'); const title = textarea.val().trim(); // insert new card to the bottom of new list |