From 0a836f90baa10cfbbeeb96ca695db649ca5cbd77 Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Thu, 9 Jan 2025 18:48:16 +0300 Subject: [PATCH] Fix plugins in forms --- .../forms/app/controller/Plugins.js | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/apps/documenteditor/forms/app/controller/Plugins.js b/apps/documenteditor/forms/app/controller/Plugins.js index f168a91ae6..1a1e54c04b 100644 --- a/apps/documenteditor/forms/app/controller/Plugins.js +++ b/apps/documenteditor/forms/app/controller/Plugins.js @@ -55,8 +55,9 @@ define([ onLaunch: function() { this.autostart = []; - + this.startOnPostLoad = false; Common.Gateway.on('init', this.loadConfig.bind(this)); + Common.NotificationCenter.on('script:loaded', this.onPostLoadComplete.bind(this)); }, loadConfig: function(data) { @@ -175,7 +176,12 @@ define([ }, help: !!help, loader: plugin.get_Loader(), - modal: isModal!==undefined ? isModal : true + modal: isModal!==undefined ? isModal : !variation.get_InsideMode(), + resizable: !!variation.get_InsideMode(), + minwidth: variation.get_InsideMode() ? 300 : undefined, + minheight: variation.get_InsideMode() ? 300 : undefined, + maxwidth: variation.get_InsideMode() ? Common.Utils.innerWidth() : undefined, + maxheight: variation.get_InsideMode() ? Common.Utils.innerHeight() : undefined }); me.pluginDlg.on({ 'render:after': function(obj){ @@ -231,6 +237,10 @@ define([ } }, + onPostLoadComplete: function() { + this.startOnPostLoad && this.runAutoStartPlugins(); + }, + resetPluginsList: function() { this.getApplication().getCollection('Common.Collections.Plugins').reset(); }, @@ -341,7 +351,8 @@ define([ if (this.appOptions.canPlugins) { this.refreshPluginsList(); - this.runAutoStartPlugins(); + this.startOnPostLoad = !Common.Controllers.LaunchController.isScriptLoaded(); + !this.startOnPostLoad && this.runAutoStartPlugins(); } },