summaryrefslogtreecommitdiffstats
path: root/client/components/main
diff options
context:
space:
mode:
authorLauri Ojansivu <x@xet7.org>2020-05-24 03:13:53 +0300
committerLauri Ojansivu <x@xet7.org>2020-05-24 03:13:53 +0300
commit055b5285328f495203a7e225fdecd04bcf5c8b32 (patch)
tree361621362801c5409a08d60f45ebedb9f1cf9c02 /client/components/main
parentfda392e662a842aa7e686ce13870c8adb35c35ab (diff)
parent921460db4031134db863e32101c0ad60a17416b5 (diff)
downloadwekan-055b5285328f495203a7e225fdecd04bcf5c8b32.tar.gz
wekan-055b5285328f495203a7e225fdecd04bcf5c8b32.tar.bz2
wekan-055b5285328f495203a7e225fdecd04bcf5c8b32.zip
Merge branch 'lib-change' of https://github.com/PDIS/wekan into
PDIS-lib-change
Diffstat (limited to 'client/components/main')
-rwxr-xr-xclient/components/main/editor.js50
1 files changed, 24 insertions, 26 deletions
diff --git a/client/components/main/editor.js b/client/components/main/editor.js
index 0c2e3186..abe4160f 100755
--- a/client/components/main/editor.js
+++ b/client/components/main/editor.js
@@ -152,33 +152,31 @@ Template.editor.onRendered(() => {
const processData = function(fileObj) {
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.url();
- 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();
+ });
+ }
}
},
);