diff options
author | Thuan Pham Quoc <thuanpq.io@gmail.com> | 2017-12-18 22:40:01 +0700 |
---|---|---|
committer | Thuan Pham Quoc <thuanpq.io@gmail.com> | 2017-12-18 22:40:01 +0700 |
commit | c3e67510c8da555e036006068b383479ba6ab07e (patch) | |
tree | e648c75c600bbe49c2c644e845b375f17e6d3f58 /client/components | |
parent | 4fad48e7ac6c13e109b0d0bcab8e42721db2ab46 (diff) | |
download | wekan-c3e67510c8da555e036006068b383479ba6ab07e.tar.gz wekan-c3e67510c8da555e036006068b383479ba6ab07e.tar.bz2 wekan-c3e67510c8da555e036006068b383479ba6ab07e.zip |
Update - auto update card cover with new image uploaded via drag&drop
Diffstat (limited to 'client/components')
-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(); |