summaryrefslogtreecommitdiffstats
path: root/client/components
diff options
context:
space:
mode:
authorThuan Pham Quoc <thuanpq.io@gmail.com>2017-12-09 00:36:23 +0700
committerThuan Pham Quoc <thuanpq.io@gmail.com>2017-12-09 00:36:23 +0700
commit84d60b5908c4e2e7bc90939ba311bad7a5fecffd (patch)
treeb6f9faeaf8252d661ac13ad117fa55f4da1ef80f /client/components
parente2f768c6a0f913b7c5f07695dce8cec692037255 (diff)
downloadwekan-84d60b5908c4e2e7bc90939ba311bad7a5fecffd.tar.gz
wekan-84d60b5908c4e2e7bc90939ba311bad7a5fecffd.tar.bz2
wekan-84d60b5908c4e2e7bc90939ba311bad7a5fecffd.zip
Added - auto update card cover with latest uploaded image attachment of card
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();
});
},