diff options
author | Sam X. Chen <sam.xi.chen@gmail.com> | 2019-08-10 21:21:42 -0400 |
---|---|---|
committer | Sam X. Chen <sam.xi.chen@gmail.com> | 2019-08-10 21:21:42 -0400 |
commit | 67d23ff8ae691397ae9a5c12699397e01e34408e (patch) | |
tree | 2019baaa53fb21415408e1584a43f4353a1b2639 /client/components/cards | |
parent | 77b5244723db4602077c362843833b539c6a88fd (diff) | |
download | wekan-67d23ff8ae691397ae9a5c12699397e01e34408e.tar.gz wekan-67d23ff8ae691397ae9a5c12699397e01e34408e.tar.bz2 wekan-67d23ff8ae691397ae9a5c12699397e01e34408e.zip |
Add Feature: Richer Editor insert picture as attachment instead of b64 string
Diffstat (limited to 'client/components/cards')
-rw-r--r-- | client/components/cards/attachments.js | 27 |
1 files changed, 6 insertions, 21 deletions
diff --git a/client/components/cards/attachments.js b/client/components/cards/attachments.js index d60169c3..843f1eb7 100644 --- a/client/components/cards/attachments.js +++ b/client/components/cards/attachments.js @@ -55,27 +55,12 @@ Template.cardAttachmentsPopup.events({ 'change .js-attach-file'(event) { const card = this; const processFile = f => { - const file = new FS.File(f); - if (card.isLinkedCard()) { - file.boardId = Cards.findOne(card.linkedId).boardId; - file.cardId = card.linkedId; - } else { - file.boardId = card.boardId; - file.swimlaneId = card.swimlaneId; - file.listId = card.listId; - file.cardId = card._id; - } - file.userId = Meteor.userId(); - if (file.original) { - file.original.name = f.name; - } - const attachment = Attachments.insert(file); - - if (attachment && attachment._id && attachment.isImage()) { - card.setCover(attachment._id); - } - - Popup.close(); + Utils.processUploadedAttachment(card, f, attachment => { + if (attachment && attachment._id && attachment.isImage()) { + card.setCover(attachment._id); + } + Popup.close(); + }); }; FS.Utility.eachFile(event, f => { |