diff options
author | Lauri Ojansivu <x@xet7.org> | 2017-12-11 22:06:14 +0200 |
---|---|---|
committer | Lauri Ojansivu <x@xet7.org> | 2017-12-11 22:06:14 +0200 |
commit | 07954c0f6d35565ddcfbddddac5ae1bf5d8e7b05 (patch) | |
tree | 3988d84b4b5ce63290c6b66ec3f4bd62aeea262f /client/components/cards | |
parent | a282a38ecdc4a4c22af2e069a2809b3dac392262 (diff) | |
parent | 84d60b5908c4e2e7bc90939ba311bad7a5fecffd (diff) | |
download | wekan-07954c0f6d35565ddcfbddddac5ae1bf5d8e7b05.tar.gz wekan-07954c0f6d35565ddcfbddddac5ae1bf5d8e7b05.tar.bz2 wekan-07954c0f6d35565ddcfbddddac5ae1bf5d8e7b05.zip |
Merge branch 'auto-update-card-cover-with-latest-uploaded-image' of https://github.com/thuanpq/wekan into thuanpq-auto-update-card-cover-with-latest-uploaded-image
Diffstat (limited to 'client/components/cards')
-rw-r--r-- | client/components/cards/attachments.js | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/client/components/cards/attachments.js b/client/components/cards/attachments.js index 36e8a5ec..b1f88bf1 100644 --- a/client/components/cards/attachments.js +++ b/client/components/cards/attachments.js @@ -60,7 +60,13 @@ Template.cardAttachmentsPopup.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); + } + Popup.close(); }); }, |