summaryrefslogtreecommitdiffstats
path: root/client/components/cards
diff options
context:
space:
mode:
authorLauri Ojansivu <x@xet7.org>2017-12-11 22:06:14 +0200
committerLauri Ojansivu <x@xet7.org>2017-12-11 22:06:14 +0200
commit07954c0f6d35565ddcfbddddac5ae1bf5d8e7b05 (patch)
tree3988d84b4b5ce63290c6b66ec3f4bd62aeea262f /client/components/cards
parenta282a38ecdc4a4c22af2e069a2809b3dac392262 (diff)
parent84d60b5908c4e2e7bc90939ba311bad7a5fecffd (diff)
downloadwekan-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.js8
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();
});
},