From 01a5626e173548a8427a1a61e2b68902fd8fd1aa Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Mon, 4 Oct 2021 19:29:27 +0300 Subject: [PATCH] Refactoring insert image from storage using fileChoiceUrl --- apps/documenteditor/main/app/controller/Toolbar.js | 2 ++ apps/presentationeditor/main/app/controller/Toolbar.js | 2 ++ apps/spreadsheeteditor/main/app/controller/Toolbar.js | 2 ++ 3 files changed, 6 insertions(+) diff --git a/apps/documenteditor/main/app/controller/Toolbar.js b/apps/documenteditor/main/app/controller/Toolbar.js index f4738e7b8..a2be82ea9 100644 --- a/apps/documenteditor/main/app/controller/Toolbar.js +++ b/apps/documenteditor/main/app/controller/Toolbar.js @@ -1611,6 +1611,8 @@ define([ fileChoiceUrl: this.toolbar.mode.fileChoiceUrl.replace("{fileExt}", "").replace("{documentType}", "ImagesOnly") })).on('selectfile', function(obj, file){ file && (file.c = type); + !file.images && (file.images = [{fileType: file.fileType, url: file.url}]); // SelectFileDlg uses old format for inserting image + file.url = null; me.insertImage(file); }).show(); } diff --git a/apps/presentationeditor/main/app/controller/Toolbar.js b/apps/presentationeditor/main/app/controller/Toolbar.js index c2e3935db..38dcbfe6b 100644 --- a/apps/presentationeditor/main/app/controller/Toolbar.js +++ b/apps/presentationeditor/main/app/controller/Toolbar.js @@ -1612,6 +1612,8 @@ define([ fileChoiceUrl: this.toolbar.mode.fileChoiceUrl.replace("{fileExt}", "").replace("{documentType}", "ImagesOnly") })).on('selectfile', function(obj, file){ file && (file.c = type); + !file.images && (file.images = [{fileType: file.fileType, url: file.url}]); // SelectFileDlg uses old format for inserting image + file.url = null; me.insertImage(file); }).show(); } diff --git a/apps/spreadsheeteditor/main/app/controller/Toolbar.js b/apps/spreadsheeteditor/main/app/controller/Toolbar.js index 3708caab1..2152752a6 100644 --- a/apps/spreadsheeteditor/main/app/controller/Toolbar.js +++ b/apps/spreadsheeteditor/main/app/controller/Toolbar.js @@ -894,6 +894,8 @@ define([ fileChoiceUrl: this.toolbar.mode.fileChoiceUrl.replace("{fileExt}", "").replace("{documentType}", "ImagesOnly") })).on('selectfile', function(obj, file){ file && (file.c = type); + !file.images && (file.images = [{fileType: file.fileType, url: file.url}]); // SelectFileDlg uses old format for inserting image + file.url = null; me.insertImage(file); }).show(); }