diff options
author | Erik Turk <erik.turk@ontera.ca> | 2018-02-05 14:47:37 -0500 |
---|---|---|
committer | Erik Turk <erik.turk@ontera.ca> | 2018-02-05 14:47:37 -0500 |
commit | 9705118ca28a0f89043ad86f6a5c9abd1813e594 (patch) | |
tree | 38c078be6b6da1aed340242850eaf0f3af2d623b /client/components/cards | |
parent | 326b4c53505596497372061f5f67057f0eaf8eca (diff) | |
download | wekan-9705118ca28a0f89043ad86f6a5c9abd1813e594.tar.gz wekan-9705118ca28a0f89043ad86f6a5c9abd1813e594.tar.bz2 wekan-9705118ca28a0f89043ad86f6a5c9abd1813e594.zip |
add titleList.split to copyManyCard
Diffstat (limited to 'client/components/cards')
-rw-r--r-- | client/components/cards/cardDetails.js | 51 |
1 files changed, 28 insertions, 23 deletions
diff --git a/client/components/cards/cardDetails.js b/client/components/cards/cardDetails.js index a2168b29..83cb9fc3 100644 --- a/client/components/cards/cardDetails.js +++ b/client/components/cards/cardDetails.js @@ -307,41 +307,46 @@ Template.copyManyCardPopup.events({ const list = Lists.findOne(card.listId); card.boardId = list.boardId; const textarea = $(evt.currentTarget).parents('.content').find('textarea'); - const title = textarea.val().trim(); + const titleEntry = textarea.val().trim(); // insert new card to the bottom of new list card.sort = Lists.findOne(this._id).cards().count(); - if (title) { - card.title = title; - card.coverId = ''; - const _id = Cards.insert(card); - // In case the filter is active we need to add the newly inserted card in + if (titleEntry) { + var title, titleList; + + for (let title of titleList.split(",") { + + card.title = title; + card.coverId = ''; + const _id = Cards.insert(card); +// 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/wekan/wekan/issues/80 - Filter.addException(_id); + Filter.addException(_id); // copy checklists - let cursor = Checklists.find({cardId: oldId}); - cursor.forEach(function() { - 'use strict'; - const checklist = arguments[0]; - checklist.cardId = _id; - checklist._id = null; - Checklists.insert(checklist); - }); + let cursor = Checklists.find({cardId: oldId}); + cursor.forEach(function() { + 'use strict'; + const checklist = arguments[0]; + checklist.cardId = _id; + checklist._id = null; + Checklists.insert(checklist); + }); // copy card comments - cursor = CardComments.find({cardId: oldId}); - cursor.forEach(function () { - 'use strict'; - const comment = arguments[0]; - comment.cardId = _id; - comment._id = null; - CardComments.insert(comment); - }); + cursor = CardComments.find({cardId: oldId}); + cursor.forEach(function () { + 'use strict'; + const comment = arguments[0]; + comment.cardId = _id; + comment._id = null; + CardComments.insert(comment); + }); Popup.close(); } + } }, }); |