소스 검색

Merge branch 'auto-setting-card-cover-with-drag-drop' of https://github.com/thuanpq/wekan into thuanpq-auto-setting-card-cover-with-drag-drop

Lauri Ojansivu 7 년 전
부모
커밋
62d000cd67
1개의 변경된 파일6개의 추가작업 그리고 1개의 파일을 삭제
  1. 6 1
      client/components/cards/attachments.js

+ 6 - 1
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();