diff --git a/apps/documenteditor/main/app/controller/LeftMenu.js b/apps/documenteditor/main/app/controller/LeftMenu.js index a0304e2e2..c5820df8a 100644 --- a/apps/documenteditor/main/app/controller/LeftMenu.js +++ b/apps/documenteditor/main/app/controller/LeftMenu.js @@ -836,6 +836,7 @@ define([ onPluginOpen: function(panel, type, action) { if ( type == 'onboard' ) { if ( action == 'open' ) { + this.tryToShowLeftMenu(); this.leftMenu.close(); this.leftMenu.panelPlugins.show(); this.leftMenu.onBtnMenuClick({pressed:true, options: {action: 'plugins'}}); @@ -862,6 +863,7 @@ define([ if (this.mode.canCoAuthoring && this.mode.canChat && !this.mode.isLightVersion) { if (state) { Common.UI.Menu.Manager.hideAll(); + this.tryToShowLeftMenu(); this.leftMenu.showMenu('chat'); } else { this.leftMenu.btnChat.toggle(false, true); @@ -873,6 +875,7 @@ define([ onShowHideNavigation: function(state) { if (state) { Common.UI.Menu.Manager.hideAll(); + this.tryToShowLeftMenu(); this.leftMenu.showMenu('navigation'); } else { this.leftMenu.btnNavigation.toggle(false, true); @@ -922,12 +925,19 @@ define([ !status && this.leftMenu.close(); status ? this.leftMenu.show() : this.leftMenu.hide(); Common.localStorage.setBool('de-hidden-leftmenu', !status); + + !view && this.leftMenu.fireEvent('view:hide', [this, !status]); } Common.NotificationCenter.trigger('layout:changed', 'main'); Common.NotificationCenter.trigger('edit:complete', this.leftMenu); }, + tryToShowLeftMenu: function() { + if ((!this.mode.canBrandingExt || !this.mode.customization || this.mode.customization.leftMenu !== false) && Common.UI.LayoutManager.isElementVisible('leftMenu')) + this.onLeftMenuHide(null, true); + }, + textNoTextFound : 'Text not found', newDocumentTitle : 'Unnamed document', requestEditRightsText : 'Requesting editing rights...', diff --git a/apps/documenteditor/main/app/controller/ViewTab.js b/apps/documenteditor/main/app/controller/ViewTab.js index 921db2e4a..2b9958fc2 100644 --- a/apps/documenteditor/main/app/controller/ViewTab.js +++ b/apps/documenteditor/main/app/controller/ViewTab.js @@ -98,6 +98,11 @@ define([ 'view:hide': _.bind(function (statusbar, state) { this.view.chStatusbar.setValue(!state, true); }, this) + }, + 'LeftMenu': { + 'view:hide': _.bind(function (leftmenu, state) { + this.view.chLeftMenu.setValue(!state, true); + }, this) } }); }, diff --git a/apps/documenteditor/main/app/view/LeftMenu.js b/apps/documenteditor/main/app/view/LeftMenu.js index 55f2eb040..f4e47595d 100644 --- a/apps/documenteditor/main/app/view/LeftMenu.js +++ b/apps/documenteditor/main/app/view/LeftMenu.js @@ -202,7 +202,8 @@ define([ this.$el.width(parseInt(Common.localStorage.getItem('de-mainmenu-width')) || MENU_SCALE_PART); } } else if (!this._state.pluginIsRunning) { - this.isVisible() && Common.localStorage.setItem('de-mainmenu-width',this.$el.width()); + var width = this.$el.width(); + this.isVisible() && (width>SCALE_MIN) && Common.localStorage.setItem('de-mainmenu-width', width); this.$el.width(SCALE_MIN); } @@ -327,7 +328,7 @@ define([ } if (this.panelNavigation) { this.panelNavigation['hide'](); - this.btnNavigation.toggle(false, true); + this.btnNavigation.toggle(false); } if (this.panelSearch) { this.panelSearch['hide']();