From b298f9207ff211c4d3aafc8fcdbd9a1cfe160679 Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Mon, 16 Dec 2024 11:21:50 +0300 Subject: [PATCH] Fix plugin's window --- apps/pdfeditor/main/app/controller/Toolbar.js | 5 ++++- apps/presentationeditor/main/app/controller/Toolbar.js | 5 ++++- apps/spreadsheeteditor/main/app/controller/Toolbar.js | 5 ++++- apps/visioeditor/main/app/controller/Toolbar.js | 5 ++++- 4 files changed, 16 insertions(+), 4 deletions(-) diff --git a/apps/pdfeditor/main/app/controller/Toolbar.js b/apps/pdfeditor/main/app/controller/Toolbar.js index f194b6577f..35ed14d0c4 100644 --- a/apps/pdfeditor/main/app/controller/Toolbar.js +++ b/apps/pdfeditor/main/app/controller/Toolbar.js @@ -2405,7 +2405,10 @@ define([ }, onPluginToolbarMenu: function(data) { - this.toolbar && Array.prototype.push.apply(this.toolbar.lockControls, Common.UI.LayoutManager.addCustomControls(this.toolbar, data)); + var api = this.api; + this.toolbar && Array.prototype.push.apply(this.toolbar.lockControls, Common.UI.LayoutManager.addCustomControls(this.toolbar, data, function(guid, value, pressed) { + api && api.onPluginToolbarMenuItemClick(guid, value, pressed); + })); }, onPluginToolbarCustomMenuItems: function(action, data) { diff --git a/apps/presentationeditor/main/app/controller/Toolbar.js b/apps/presentationeditor/main/app/controller/Toolbar.js index 9c261d1406..4524aa9fc1 100644 --- a/apps/presentationeditor/main/app/controller/Toolbar.js +++ b/apps/presentationeditor/main/app/controller/Toolbar.js @@ -2967,7 +2967,10 @@ define([ }, onPluginToolbarMenu: function(data) { - this.toolbar && Array.prototype.push.apply(this.toolbar.lockControls, Common.UI.LayoutManager.addCustomControls(this.toolbar, data)); + var api = this.api; + this.toolbar && Array.prototype.push.apply(this.toolbar.lockControls, Common.UI.LayoutManager.addCustomControls(this.toolbar, data, function(guid, value, pressed) { + api && api.onPluginToolbarMenuItemClick(guid, value, pressed); + })); }, onPluginToolbarCustomMenuItems: function(action, data) { diff --git a/apps/spreadsheeteditor/main/app/controller/Toolbar.js b/apps/spreadsheeteditor/main/app/controller/Toolbar.js index 8c429aa41b..9157353478 100644 --- a/apps/spreadsheeteditor/main/app/controller/Toolbar.js +++ b/apps/spreadsheeteditor/main/app/controller/Toolbar.js @@ -5218,7 +5218,10 @@ define([ }, onPluginToolbarMenu: function(data) { - this.toolbar && Array.prototype.push.apply(this.toolbar.lockControls, Common.UI.LayoutManager.addCustomControls(this.toolbar, data)); + var api = this.api; + this.toolbar && Array.prototype.push.apply(this.toolbar.lockControls, Common.UI.LayoutManager.addCustomControls(this.toolbar, data, function(guid, value, pressed) { + api && api.onPluginToolbarMenuItemClick(guid, value, pressed); + })); }, onPluginToolbarCustomMenuItems: function(action, data) { diff --git a/apps/visioeditor/main/app/controller/Toolbar.js b/apps/visioeditor/main/app/controller/Toolbar.js index fa3f818374..4a2cd30294 100644 --- a/apps/visioeditor/main/app/controller/Toolbar.js +++ b/apps/visioeditor/main/app/controller/Toolbar.js @@ -346,7 +346,10 @@ define([ }, onPluginToolbarMenu: function(data) { - this.toolbar && Array.prototype.push.apply(this.toolbar.lockControls, Common.UI.LayoutManager.addCustomControls(this.toolbar, data)); + var api = this.api; + this.toolbar && Array.prototype.push.apply(this.toolbar.lockControls, Common.UI.LayoutManager.addCustomControls(this.toolbar, data, function(guid, value, pressed) { + api && api.onPluginToolbarMenuItemClick(guid, value, pressed); + })); }, onPluginToolbarCustomMenuItems: function(action, data) {