[DE] Show left panel when press chat or headers

This commit is contained in:
Julia Radzhabova 2022-10-18 19:52:47 +03:00
parent 62aa5cffed
commit 95e265d018
3 changed files with 18 additions and 2 deletions

View file

@ -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...',

View file

@ -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)
}
});
},

View file

@ -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']();