summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLauri Ojansivu <x@xet7.org>2017-12-20 14:12:52 +0200
committerLauri Ojansivu <x@xet7.org>2017-12-20 14:12:52 +0200
commit62d000cd67663e92da4359b392b19bbd14b7a152 (patch)
tree02bbcb9e0dac55aa145a28c387a39d06852a4cdd
parent0c15048bdd1da5928525585b1d24c5dbe8a68bbc (diff)
parentc3e67510c8da555e036006068b383479ba6ab07e (diff)
downloadwekan-62d000cd67663e92da4359b392b19bbd14b7a152.tar.gz
wekan-62d000cd67663e92da4359b392b19bbd14b7a152.tar.bz2
wekan-62d000cd67663e92da4359b392b19bbd14b7a152.zip
Merge branch 'auto-setting-card-cover-with-drag-drop' of https://github.com/thuanpq/wekan into thuanpq-auto-setting-card-cover-with-drag-drop
-rw-r--r--client/components/cards/attachments.js7
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();