diff options
author | Lauri Ojansivu <x@xet7.org> | 2017-12-20 14:12:52 +0200 |
---|---|---|
committer | Lauri Ojansivu <x@xet7.org> | 2017-12-20 14:12:52 +0200 |
commit | 62d000cd67663e92da4359b392b19bbd14b7a152 (patch) | |
tree | 02bbcb9e0dac55aa145a28c387a39d06852a4cdd | |
parent | 0c15048bdd1da5928525585b1d24c5dbe8a68bbc (diff) | |
parent | c3e67510c8da555e036006068b383479ba6ab07e (diff) | |
download | wekan-62d000cd67663e92da4359b392b19bbd14b7a152.tar.gz wekan-62d000cd67663e92da4359b392b19bbd14b7a152.tar.bz2 wekan-62d000cd67663e92da4359b392b19bbd14b7a152.zip |
Merge branch 'auto-setting-card-cover-with-drag-drop' of https://github.com/thuanpq/wekan into thuanpq-auto-setting-card-cover-with-drag-drop
-rw-r--r-- | client/components/cards/attachments.js | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/client/components/cards/attachments.js b/client/components/cards/attachments.js index b1f88bf1..bc7d3979 100644 --- a/client/components/cards/attachments.js +++ b/client/components/cards/attachments.js @@ -113,7 +113,12 @@ Template.previewClipboardImagePopup.events({ file.boardId = card.boardId; file.cardId = card._id; file.userId = Meteor.userId(); - Attachments.insert(file); + const attachment = Attachments.insert(file); + + if (attachment && attachment._id && attachment.isImage()) { + card.setCover(attachment._id); + } + pastedResults = null; $(document.body).pasteImageReader(() => {}); Popup.close(); |