From 2ff7b2bd99d9bdfed525bfb4296fc8806027c25e 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 a58af342e..79f34a522 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 11219b260..f8d1bbb61 100644 --- a/apps/presentationeditor/main/app/controller/Toolbar.js +++ b/apps/presentationeditor/main/app/controller/Toolbar.js @@ -1628,6 +1628,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 d8036d911..9b29a6259 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(); }