diff options
author | Lauri Ojansivu <x@xet7.org> | 2017-11-20 17:46:34 +0200 |
---|---|---|
committer | Lauri Ojansivu <x@xet7.org> | 2017-11-20 17:46:34 +0200 |
commit | b592e8ad14ab5ae8de7605e5870a9fe703d15874 (patch) | |
tree | b76fe2df6f7d2641200089eeb56c6799113e5cdc /client/components/cards/cardDetails.js | |
parent | dfd0b2194746208c85b16fd485e7ca6f0cc34b57 (diff) | |
parent | ce4f1589762e82dd9175444eeca4d6d0e2f79d1e (diff) | |
download | wekan-b592e8ad14ab5ae8de7605e5870a9fe703d15874.tar.gz wekan-b592e8ad14ab5ae8de7605e5870a9fe703d15874.tar.bz2 wekan-b592e8ad14ab5ae8de7605e5870a9fe703d15874.zip |
Merge branch 'feature/copy-move-cards-x-boards' of https://github.com/GhassenRjab/wekan into GhassenRjab-feature/copy-move-cards-x-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 3825bda8..c358b306 100644 --- a/client/components/cards/cardDetails.js +++ b/client/components/cards/cardDetails.js @@ -215,12 +215,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 |