summaryrefslogtreecommitdiffstats
path: root/client/components
diff options
context:
space:
mode:
authorLauri Ojansivu <x@xet7.org>2017-12-11 22:08:17 +0200
committerLauri Ojansivu <x@xet7.org>2017-12-11 22:08:17 +0200
commit7214e4bb2f66c648d45cc1f4faf3c341c9a2144c (patch)
tree876761783f4e7f7e12b18a0016a1867bc838f721 /client/components
parenta282a38ecdc4a4c22af2e069a2809b3dac392262 (diff)
parentfd7a140429425fbc6c5cffc8d12f2da03e950e13 (diff)
downloadwekan-7214e4bb2f66c648d45cc1f4faf3c341c9a2144c.tar.gz
wekan-7214e4bb2f66c648d45cc1f4faf3c341c9a2144c.tar.bz2
wekan-7214e4bb2f66c648d45cc1f4faf3c341c9a2144c.zip
Merge branch 'thuanpq-auto-update-card-cover-with-latest-uploaded-image' into devel
Diffstat (limited to 'client/components')
-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();
});
},