diff --git a/apps/documenteditor/main/app/controller/RightMenu.js b/apps/documenteditor/main/app/controller/RightMenu.js index ed8a8afd3b..af0d09a3ad 100644 --- a/apps/documenteditor/main/app/controller/RightMenu.js +++ b/apps/documenteditor/main/app/controller/RightMenu.js @@ -577,7 +577,7 @@ define([ }, tryToShowRightMenu: function() { - if (this.rightmenu && this.rightmenu.mode && (!this.rightmenu.mode.canBrandingExt || !this.rightmenu.mode.customization || this.mode.customization.rightMenu !== false) && Common.UI.LayoutManager.isElementVisible('rightMenu')) + if (this.rightmenu && this.rightmenu.mode && (!this.rightmenu.mode.canBrandingExt || !this.rightmenu.mode.customization || this.rightmenu.mode.customization.rightMenu !== false) && Common.UI.LayoutManager.isElementVisible('rightMenu')) this.onRightMenuHide(null, true); }, diff --git a/apps/presentationeditor/main/app/controller/RightMenu.js b/apps/presentationeditor/main/app/controller/RightMenu.js index 3802cc3a05..cbd8e7a77a 100644 --- a/apps/presentationeditor/main/app/controller/RightMenu.js +++ b/apps/presentationeditor/main/app/controller/RightMenu.js @@ -441,6 +441,7 @@ define([ this.onFocusObject(selectedElements, false, !Common.Utils.InternalSettings.get("pe-hide-right-settings")); this._lastVisibleSettings = undefined; } + !view && this.rightmenu.fireEvent('view:hide', [this, !status]); Common.localStorage.setBool('pe-hidden-rightmenu', !status); Common.Utils.InternalSettings.set("pe-hidden-rightmenu", !status); } @@ -452,11 +453,17 @@ define([ onRightMenuOpen: function(type) { if (this._settings[type]===undefined || this._settings[type].hidden || this._settings[type].btn.isDisabled() || this._settings[type].panelId===this.rightmenu.GetActivePane()) return; + this.tryToShowRightMenu(); this.rightmenu.SetActivePane(type, true); this._settings[type].panel.ChangeSettings.call(this._settings[type].panel, this._settings[type].props); this.rightmenu.updateScroller(); }, + tryToShowRightMenu: function() { + if (this.rightmenu && this.rightmenu.mode && (!this.rightmenu.mode.canBrandingExt || !this.rightmenu.mode.customization || this.rightmenu.mode.customization.rightMenu !== false) && Common.UI.LayoutManager.isElementVisible('rightMenu')) + this.onRightMenuHide(null, true); + }, + addNewPlugin: function (button, $button, $panel) { this.rightmenu.insertButton(button, $button); this.rightmenu.insertPanel($panel); diff --git a/apps/presentationeditor/main/app/controller/ViewTab.js b/apps/presentationeditor/main/app/controller/ViewTab.js index 66b7cde4c1..cd3a27d4de 100644 --- a/apps/presentationeditor/main/app/controller/ViewTab.js +++ b/apps/presentationeditor/main/app/controller/ViewTab.js @@ -135,6 +135,11 @@ define([ 'view:hide': _.bind(function (leftmenu, state) { this.view.chLeftMenu.setValue(!state, true); }, this) + }, + 'RightMenu': { + 'view:hide': _.bind(function (leftmenu, state) { + this.view.chRightMenu.setValue(!state, true); + }, this) } }); }, diff --git a/apps/presentationeditor/main/app/view/RightMenu.js b/apps/presentationeditor/main/app/view/RightMenu.js index 9b04ac9963..4d171a8a18 100644 --- a/apps/presentationeditor/main/app/view/RightMenu.js +++ b/apps/presentationeditor/main/app/view/RightMenu.js @@ -244,6 +244,7 @@ define([ }, setMode: function(mode) { + this.mode = mode; this.imageSettings && this.imageSettings.setMode(mode); this.shapeSettings && this.shapeSettings.setMode(mode); this.slideSettings && this.slideSettings.setMode(mode); diff --git a/apps/spreadsheeteditor/main/app/controller/RightMenu.js b/apps/spreadsheeteditor/main/app/controller/RightMenu.js index 45e78468b9..abd0810c3f 100644 --- a/apps/spreadsheeteditor/main/app/controller/RightMenu.js +++ b/apps/spreadsheeteditor/main/app/controller/RightMenu.js @@ -523,6 +523,7 @@ define([ this.onSelectionChanged(this.api.asc_getCellInfo()); this._lastVisibleSettings = undefined; } + !view && this.rightmenu.fireEvent('view:hide', [this, !status]); Common.localStorage.setBool('sse-hidden-rightmenu', !status); } @@ -533,11 +534,17 @@ define([ onRightMenuOpen: function(type) { if (this._settings[type]===undefined || this._settings[type].hidden || this._settings[type].btn.isDisabled() || this._settings[type].panelId===this.rightmenu.GetActivePane()) return; + this.tryToShowRightMenu(); this.rightmenu.SetActivePane(type, true); this._settings[type].panel.ChangeSettings.call(this._settings[type].panel, this._settings[type].props); this.rightmenu.updateScroller(); }, + tryToShowRightMenu: function() { + if (this.rightmenu && this.rightmenu.mode && (!this.rightmenu.mode.canBrandingExt || !this.rightmenu.mode.customization || this.rightmenu.mode.customization.rightMenu !== false) && Common.UI.LayoutManager.isElementVisible('rightMenu')) + this.onRightMenuHide(null, true); + }, + addNewPlugin: function (button, $button, $panel) { this.rightmenu.insertButton(button, $button); this.rightmenu.insertPanel($panel); diff --git a/apps/spreadsheeteditor/main/app/controller/ViewTab.js b/apps/spreadsheeteditor/main/app/controller/ViewTab.js index f396597fe4..71b6c670ae 100644 --- a/apps/spreadsheeteditor/main/app/controller/ViewTab.js +++ b/apps/spreadsheeteditor/main/app/controller/ViewTab.js @@ -117,6 +117,11 @@ define([ 'view:hide': _.bind(function (leftmenu, state) { this.view.chLeftMenu.setValue(!state, true); }, this) + }, + 'RightMenu': { + 'view:hide': _.bind(function (leftmenu, state) { + this.view.chRightMenu.setValue(!state, true); + }, this) } }); Common.NotificationCenter.on('layout:changed', _.bind(this.onLayoutChanged, this));