Update - auto update card cover with new image uploaded via drag&drop

This commit is contained in:
Thuan Pham Quoc 2017-12-18 22:40:01 +07:00
parent 4fad48e7ac
commit c3e67510c8

View file

@ -113,7 +113,12 @@ Template.previewClipboardImagePopup.events({
file.boardId = card.boardId; file.boardId = card.boardId;
file.cardId = card._id; file.cardId = card._id;
file.userId = Meteor.userId(); file.userId = Meteor.userId();
Attachments.insert(file); const attachment = Attachments.insert(file);
if (attachment && attachment._id && attachment.isImage()) {
card.setCover(attachment._id);
}
pastedResults = null; pastedResults = null;
$(document.body).pasteImageReader(() => {}); $(document.body).pasteImageReader(() => {});
Popup.close(); Popup.close();