summaryrefslogtreecommitdiffstats
path: root/client/components/cards/attachments.js
diff options
context:
space:
mode:
authorLauri Ojansivu <x@xet7.org>2019-08-11 19:26:05 +0300
committerGitHub <noreply@github.com>2019-08-11 19:26:05 +0300
commit2859457600a29ae783f165d7edd8825f40859f02 (patch)
treea8ca7378d1a9c38db66de26b00fb04de0aa33993 /client/components/cards/attachments.js
parent30680f13d67e31a551511b9e6e24d807a2c8064d (diff)
parent4857bce5d953ba3299a1de4c1894a96913d4d857 (diff)
downloadwekan-2859457600a29ae783f165d7edd8825f40859f02.tar.gz
wekan-2859457600a29ae783f165d7edd8825f40859f02.tar.bz2
wekan-2859457600a29ae783f165d7edd8825f40859f02.zip
Merge pull request #2608 from whowillcare/master
Make image upload in summernote as attachment to wekan board instead of base64 string and more
Diffstat (limited to 'client/components/cards/attachments.js')
-rw-r--r--client/components/cards/attachments.js27
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 => {