diff --git a/apps/common/main/lib/view/Plugins.js b/apps/common/main/lib/view/Plugins.js index 142200af1..e2d83ac4a 100644 --- a/apps/common/main/lib/view/Plugins.js +++ b/apps/common/main/lib/view/Plugins.js @@ -234,7 +234,7 @@ define([ this.iframePlugin = null; } this.currentPluginPanel.toggleClass('hidden', true); - this.pluginsPanel.toggleClass('hidden', false); + // this.pluginsPanel.toggleClass('hidden', false); this.fireEvent('plugin:open', [this, 'onboard', 'close']); }, diff --git a/apps/documenteditor/main/app/controller/LeftMenu.js b/apps/documenteditor/main/app/controller/LeftMenu.js index 0aa35e1d9..b1e126edb 100644 --- a/apps/documenteditor/main/app/controller/LeftMenu.js +++ b/apps/documenteditor/main/app/controller/LeftMenu.js @@ -539,6 +539,13 @@ define([ if (this.api) this.api.asc_enableKeyEvents(value); if (value) $(this.leftMenu.btnAbout.el).blur(); + if (value && this.leftMenu._state.pluginIsRunning) { + this.leftMenu.panelPlugins.show(); + if (this.mode.canCoAuthoring) { + this.mode.canComments && this.leftMenu.panelComments['hide'](); + this.mode.canChat && this.leftMenu.panelChat['hide'](); + } + } }, menuFilesShowHide: function(state) { @@ -645,7 +652,9 @@ define([ this.leftMenu.close(); this.leftMenu.panelPlugins.show(); this.leftMenu.onBtnMenuClick({pressed:true, options: {action: 'plugins'}}); + this.leftMenu._state.pluginIsRunning = true; } else { + this.leftMenu._state.pluginIsRunning = false; this.leftMenu.close(); } } diff --git a/apps/documenteditor/main/app/view/LeftMenu.js b/apps/documenteditor/main/app/view/LeftMenu.js index 9b9ee6397..83e35489e 100644 --- a/apps/documenteditor/main/app/view/LeftMenu.js +++ b/apps/documenteditor/main/app/view/LeftMenu.js @@ -84,6 +84,7 @@ define([ initialize: function () { this.minimizedMode = true; + this._state = {}; }, render: function () { @@ -163,7 +164,8 @@ define([ onBtnMenuToggle: function(btn, state) { if (state) { btn.panel['show'](); - this.$el.width(SCALE_MIN); + if (!this._state.pluginIsRunning) + this.$el.width(SCALE_MIN); if (this.btnSearch.isActive()) this.btnSearch.toggle(false); @@ -190,7 +192,7 @@ define([ if (!(this.$el.width() > SCALE_MIN)) { this.$el.width(parseInt(Common.localStorage.getItem('de-mainmenu-width')) || MENU_SCALE_PART); } - } else { + } else if (!this._state.pluginIsRunning) { Common.localStorage.setItem('de-mainmenu-width',this.$el.width()); this.$el.width(SCALE_MIN); } @@ -221,12 +223,12 @@ define([ } } /** coauthoring end **/ - if (this.mode.canPlugins && this.panelPlugins) { - if (this.btnPlugins.pressed) { - this.panelPlugins.show(); - } else - this.panelPlugins['hide'](); - } + // if (this.mode.canPlugins && this.panelPlugins) { + // if (this.btnPlugins.pressed) { + // this.panelPlugins.show(); + // } else + // this.panelPlugins['hide'](); + // } }, setOptionsPanel: function(name, panel) { @@ -262,7 +264,8 @@ define([ this.menuFile.hide(); } else { this.btnAbout.toggle(false); - this.$el.width(SCALE_MIN); + if (!this._state.pluginIsRunning) + this.$el.width(SCALE_MIN); /** coauthoring begin **/ if (this.mode.canCoAuthoring) { if (this.mode.canComments) { @@ -277,7 +280,7 @@ define([ } } /** coauthoring end **/ - if (this.mode.canPlugins && this.panelPlugins) { + if (this.mode.canPlugins && this.panelPlugins && !this._state.pluginIsRunning) { this.panelPlugins['hide'](); this.btnPlugins.toggle(false, true); } diff --git a/apps/spreadsheeteditor/main/app/controller/LeftMenu.js b/apps/spreadsheeteditor/main/app/controller/LeftMenu.js index aaaa613d7..cfc67d932 100644 --- a/apps/spreadsheeteditor/main/app/controller/LeftMenu.js +++ b/apps/spreadsheeteditor/main/app/controller/LeftMenu.js @@ -607,6 +607,13 @@ define([ this.api.asc_enableKeyEvents(!state); if (!state) $(this.leftMenu.btnAbout.el).blur(); + if (!state && this.leftMenu._state.pluginIsRunning) { + this.leftMenu.panelPlugins.show(); + if (this.mode.canCoAuthoring) { + this.mode.canComments && this.leftMenu.panelComments['hide'](); + this.mode.canChat && this.leftMenu.panelChat['hide'](); + } + } } }, @@ -739,7 +746,9 @@ define([ this.leftMenu.close(); this.leftMenu.panelPlugins.show(); this.leftMenu.onBtnMenuClick({pressed:true, options: {action: 'plugins'}}); + this.leftMenu._state.pluginIsRunning = true; } else { + this.leftMenu._state.pluginIsRunning = false; this.leftMenu.close(); } } diff --git a/apps/spreadsheeteditor/main/app/view/LeftMenu.js b/apps/spreadsheeteditor/main/app/view/LeftMenu.js index b451e0c46..b39fa6412 100644 --- a/apps/spreadsheeteditor/main/app/view/LeftMenu.js +++ b/apps/spreadsheeteditor/main/app/view/LeftMenu.js @@ -74,6 +74,7 @@ define([ initialize: function () { this.minimizedMode = true; + this._state = {}; }, render: function () { @@ -153,7 +154,8 @@ define([ onBtnMenuToggle: function(btn, state) { if (state) { btn.panel['show'](); - this.$el.width(SCALE_MIN); + if (!this._state.pluginIsRunning) + this.$el.width(SCALE_MIN); if (this.btnSearch.isActive()) this.btnSearch.toggle(false); @@ -178,7 +180,7 @@ define([ if (!(this.$el.width() > SCALE_MIN)) { this.$el.width(Common.localStorage.getItem('sse-mainmenu-width') || MENU_SCALE_PART); } - } else { + } else if (!this._state.pluginIsRunning){ Common.localStorage.setItem('sse-mainmenu-width',this.$el.width()); this.$el.width(SCALE_MIN); } @@ -208,12 +210,12 @@ define([ this.panelChat['hide'](); } } - if (this.mode.canPlugins && this.panelPlugins) { - if (this.btnPlugins.pressed) { - this.panelPlugins.show(); - } else - this.panelPlugins['hide'](); - } + // if (this.mode.canPlugins && this.panelPlugins) { + // if (this.btnPlugins.pressed) { + // this.panelPlugins.show(); + // } else + // this.panelPlugins['hide'](); + // } }, setOptionsPanel: function(name, panel) { @@ -241,7 +243,8 @@ define([ close: function(menu) { this.btnAbout.toggle(false); - this.$el.width(SCALE_MIN); + if (!this._state.pluginIsRunning) + this.$el.width(SCALE_MIN); /** coauthoring begin **/ if (this.mode.canCoAuthoring) { if (this.mode.canComments) { @@ -256,7 +259,7 @@ define([ } } /** coauthoring end **/ - if (this.mode.canPlugins && this.panelPlugins) { + if (this.mode.canPlugins && this.panelPlugins && !this._state.pluginIsRunning) { this.panelPlugins['hide'](); this.btnPlugins.toggle(false, true); }