diff --git a/apps/spreadsheeteditor/main/app/controller/LeftMenu.js b/apps/spreadsheeteditor/main/app/controller/LeftMenu.js index 083c3ed83..be6031ecf 100644 --- a/apps/spreadsheeteditor/main/app/controller/LeftMenu.js +++ b/apps/spreadsheeteditor/main/app/controller/LeftMenu.js @@ -93,6 +93,9 @@ define([ }, 'SearchBar': { 'search:show': _.bind(this.onShowHideSearch, this) + }, + 'ViewTab': { + 'leftmenu:hide': _.bind(this.onLeftMenuHide, this) } }); Common.NotificationCenter.on('app:comment:add', _.bind(this.onAppAddComment, this)); @@ -826,6 +829,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'}}); @@ -841,6 +845,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); @@ -904,6 +909,24 @@ define([ return this.leftMenu && this.leftMenu.panelComments && this.leftMenu.panelComments.isVisible(); }, + onLeftMenuHide: function (view, status) { + if (this.leftMenu) { + !status && this.leftMenu.close(); + status ? this.leftMenu.show() : this.leftMenu.hide(); + Common.localStorage.setBool('sse-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', textItemEntireCell : 'Entire cell contents', diff --git a/apps/spreadsheeteditor/main/app/controller/Main.js b/apps/spreadsheeteditor/main/app/controller/Main.js index 714087669..ae35da318 100644 --- a/apps/spreadsheeteditor/main/app/controller/Main.js +++ b/apps/spreadsheeteditor/main/app/controller/Main.js @@ -1412,6 +1412,8 @@ define([ app.getController('Toolbar').setMode(this.appOptions); app.getController('DocumentHolder').setMode(this.appOptions); + viewport && viewport.applyCommonMode(); + if (this.appOptions.isEditMailMerge || this.appOptions.isEditDiagram) { statusbarView.hide(); } diff --git a/apps/spreadsheeteditor/main/app/controller/RightMenu.js b/apps/spreadsheeteditor/main/app/controller/RightMenu.js index 56d68c611..ef9cab72e 100644 --- a/apps/spreadsheeteditor/main/app/controller/RightMenu.js +++ b/apps/spreadsheeteditor/main/app/controller/RightMenu.js @@ -69,6 +69,9 @@ define([ }, 'PivotTable': { 'insertpivot': this.onInsertPivot + }, + 'ViewTab': { + 'rightmenu:hide': this.onRightMenuHide.bind(this) } }); @@ -466,6 +469,17 @@ define([ this._state.wsLock = props.wsLock; } this.onSelectionChanged(this.api.asc_getCellInfo()); + }, + + onRightMenuHide: function (view, status) { + if (this.rightmenu) { + !status && this.rightmenu.clearSelection(); + status ? this.rightmenu.show() : this.rightmenu.hide(); + Common.localStorage.setBool('sse-hidden-rightmenu', !status); + } + + Common.NotificationCenter.trigger('layout:changed', 'main'); + Common.NotificationCenter.trigger('edit:complete', this.rightmenu); } }); }); \ No newline at end of file diff --git a/apps/spreadsheeteditor/main/app/controller/ViewTab.js b/apps/spreadsheeteditor/main/app/controller/ViewTab.js index 1102f5284..7a211b90c 100644 --- a/apps/spreadsheeteditor/main/app/controller/ViewTab.js +++ b/apps/spreadsheeteditor/main/app/controller/ViewTab.js @@ -111,6 +111,11 @@ define([ 'view:compact': _.bind(function (toolbar, state) { this.view.chToolbar.setValue(!state, true); }, this) + }, + 'LeftMenu': { + 'view:hide': _.bind(function (leftmenu, state) { + this.view.chLeftMenu.setValue(!state, true); + }, this) } }); Common.NotificationCenter.on('layout:changed', _.bind(this.onLayoutChanged, this)); diff --git a/apps/spreadsheeteditor/main/app/view/LeftMenu.js b/apps/spreadsheeteditor/main/app/view/LeftMenu.js index 4d07dc04b..bb9966d06 100644 --- a/apps/spreadsheeteditor/main/app/view/LeftMenu.js +++ b/apps/spreadsheeteditor/main/app/view/LeftMenu.js @@ -179,7 +179,8 @@ define([ this.$el.width(Common.localStorage.getItem('sse-mainmenu-width') || MENU_SCALE_PART); } } else if (!this._state.pluginIsRunning){ - this.isVisible() && Common.localStorage.setItem('sse-mainmenu-width',this.$el.width()); + var width = this.$el.width(); + this.isVisible() && (width>SCALE_MIN) && Common.localStorage.setItem('sse-mainmenu-width',width); this.$el.width(SCALE_MIN); } this.onCoauthOptions(); diff --git a/apps/spreadsheeteditor/main/app/view/ViewTab.js b/apps/spreadsheeteditor/main/app/view/ViewTab.js index 8516fd2e5..5eeb0d722 100644 --- a/apps/spreadsheeteditor/main/app/view/ViewTab.js +++ b/apps/spreadsheeteditor/main/app/view/ViewTab.js @@ -101,6 +101,14 @@ define([ '' + '' + '' + + '