diff options
author | Romulus Urakagi Tsai <urakagi@gmail.com> | 2020-01-14 06:29:34 +0000 |
---|---|---|
committer | Romulus Urakagi Tsai <urakagi@gmail.com> | 2020-01-14 06:29:34 +0000 |
commit | d26bf04bfa088b770c85a895700fd704cc08e234 (patch) | |
tree | a082b90b5e26aba2cff453176bedae8a498b74b7 /client/components/main | |
parent | 6ebd6defe917a70e84467d64a1c15ec109c73f1b (diff) | |
download | wekan-d26bf04bfa088b770c85a895700fd704cc08e234.tar.gz wekan-d26bf04bfa088b770c85a895700fd704cc08e234.tar.bz2 wekan-d26bf04bfa088b770c85a895700fd704cc08e234.zip |
Change to relative path and /var/attachments to store
Diffstat (limited to 'client/components/main')
-rwxr-xr-x | client/components/main/editor.js | 47 |
1 files changed, 24 insertions, 23 deletions
diff --git a/client/components/main/editor.js b/client/components/main/editor.js index 64f24f98..bc2e0bad 100755 --- a/client/components/main/editor.js +++ b/client/components/main/editor.js @@ -225,32 +225,33 @@ Template.editor.onRendered(() => { $summernote.summernote('insertNode', img); }; const processData = function(fileObj) { - // FIXME: Change to new API Utils.processUploadedAttachment( currentCard, - fileObj, - attachment => { - if (attachment && attachment._id && attachment.isImage) { - attachment.one('uploaded', function() { - const maxTry = 3; - const checkItvl = 500; - let retry = 0; - const checkUrl = function() { - // even though uploaded event fired, attachment.url() is still null somehow //TODO - const url = attachment.link(); - if (url) { - insertImage( - `${location.protocol}//${location.host}${url}`, - ); - } else { - retry++; - if (retry < maxTry) { - setTimeout(checkUrl, checkItvl); + fileObj, + { onUploaded: + attachment => { + if (attachment && attachment._id && attachment.isImage) { + attachment.one('uploaded', function() { + const maxTry = 3; + const checkItvl = 500; + let retry = 0; + const checkUrl = function() { + // even though uploaded event fired, attachment.url() is still null somehow //TODO + const url = Attachments.link(attachment, 'original', '/'); + if (url) { + insertImage( + `${location.protocol}//${location.host}${url}`, + ); + } else { + retry++; + if (retry < maxTry) { + setTimeout(checkUrl, checkItvl); + } } - } - }; - checkUrl(); - }); + }; + checkUrl(); + }); + } } }, ); |