summaryrefslogtreecommitdiffstats
path: root/client/components/cards/attachments.js
diff options
context:
space:
mode:
authorRomulus Urakagi Tsai <urakagi@gmail.com>2019-11-20 10:40:09 +0000
committerRomulus Urakagi Tsai <urakagi@gmail.com>2019-11-20 10:40:09 +0000
commit4dcdec0084414e7dde9e630add01ecd2865bd941 (patch)
treeba145af20e31e57c48e25948d14f31469e8b2690 /client/components/cards/attachments.js
parent05c53ca01d71a01a608c9ae345475abd67c9939b (diff)
downloadwekan-4dcdec0084414e7dde9e630add01ecd2865bd941.tar.gz
wekan-4dcdec0084414e7dde9e630add01ecd2865bd941.tar.bz2
wekan-4dcdec0084414e7dde9e630add01ecd2865bd941.zip
Attachment upload from card done, need to fix download link
Diffstat (limited to 'client/components/cards/attachments.js')
-rw-r--r--client/components/cards/attachments.js23
1 files changed, 18 insertions, 5 deletions
diff --git a/client/components/cards/attachments.js b/client/components/cards/attachments.js
index 604dc078..f24a7f82 100644
--- a/client/components/cards/attachments.js
+++ b/client/components/cards/attachments.js
@@ -45,18 +45,31 @@ Template.attachmentsGalery.events({
},
});
+Template.attachmentsGalery.helpers({
+ url() {
+ return Attachments.link(this);
+ }
+});
+
Template.previewAttachedImagePopup.events({
'click .js-large-image-clicked'() {
Popup.close();
},
});
+Template.previewAttachedImagePopup.helpers({
+ url() {
+ return Attachments.link(this);
+ }
+});
+
Template.cardAttachmentsPopup.events({
'change .js-attach-file'(event) {
const card = this;
const processFile = f => {
Utils.processUploadedAttachment(card, f, attachment => {
- if (attachment && attachment._id && attachment.isImage()) {
+ console.log('attachment', attachment);
+ if (attachment && attachment._id && attachment.isImage) {
card.setCover(attachment._id);
}
Popup.close();
@@ -152,13 +165,14 @@ Template.previewClipboardImagePopup.events({
const settings = {
file: results.file,
streams: 'dynamic',
- chunkSize: 'dynamic'
+ chunkSize: 'dynamic',
};
if (!results.name) {
// if no filename, it's from clipboard. then we give it a name, with ext name from MIME type
// FIXME: Check this behavior
if (typeof results.file.type === 'string') {
- settings.fileName = new Date().getTime() + results.file.type.replace('.+/', '');
+ settings.fileName =
+ new Date().getTime() + results.file.type.replace('.+/', '');
}
}
settings.meta = {};
@@ -166,8 +180,7 @@ Template.previewClipboardImagePopup.events({
settings.meta.boardId = card.boardId;
settings.meta.cardId = card._id;
settings.meta.userId = Meteor.userId();
- console.log('settings', settings);
- const attachment = Attachments.insert(settings, false);
+ const attachment = Attachments.insert(settings);
// TODO: Check image cover behavior
if (attachment && attachment._id && attachment.isImage) {