From 195cfddf60e3ee3d5e66b73c7e67052a732d3642 Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Thu, 12 Dec 2024 20:13:45 +0300 Subject: [PATCH 1/2] [SSE] Hide pivot button in the right pane --- apps/common/main/lib/component/SideMenu.js | 9 ++++++++- .../main/app/controller/RightMenu.js | 19 ++++++++++++++----- .../main/app/view/RightMenu.js | 3 --- 3 files changed, 22 insertions(+), 9 deletions(-) diff --git a/apps/common/main/lib/component/SideMenu.js b/apps/common/main/lib/component/SideMenu.js index a965cdc53e..0b62a5964a 100644 --- a/apps/common/main/lib/component/SideMenu.js +++ b/apps/common/main/lib/component/SideMenu.js @@ -164,6 +164,13 @@ define([ } }, + clearMoreButton: function() { + this.buttons && this.buttons.forEach(function (btn) { + btn.cmpEl.show(); + }); + this.btnMore.hide(); + }, + onMenuMore: function (menu, item) { var btn = this.buttons[item.value]; if (btn.cmpEl.prop('id') !== 'left-btn-support') @@ -190,7 +197,7 @@ define([ setDisabledMoreMenuItem: function (btn, disabled) { if (this.btnMore && !btn.cmpEl.is(':visible')) { var index =_.indexOf(this.buttons, btn), - item = _.findWhere(this.btnMore.menu.items, {value: index}) + item = _.findWhere(this.btnMore.menu.items, {value: index}); item && item.setDisabled(disabled); } }, diff --git a/apps/spreadsheeteditor/main/app/controller/RightMenu.js b/apps/spreadsheeteditor/main/app/controller/RightMenu.js index 51ae4221f1..07e8ce71a6 100644 --- a/apps/spreadsheeteditor/main/app/controller/RightMenu.js +++ b/apps/spreadsheeteditor/main/app/controller/RightMenu.js @@ -52,7 +52,7 @@ define([ initialize: function() { this.editMode = true; - this._state = {wsLock: false, wsProps: []}; + this._state = {wsLock: false, wsProps: [], inPivot: false}; this.addListeners({ 'Toolbar': { @@ -252,11 +252,20 @@ define([ this._settings[settingsType].btn.updateHint(this.rightmenu.txtSparklineSettings); } - if (pivotInfo && this.rightmenu.mode.canFeaturePivot) { + if (this.rightmenu.mode.canFeaturePivot) { settingsType = Common.Utils.documentSettingsType.Pivot; - this._settings[settingsType].props = pivotInfo; - this._settings[settingsType].locked = isPivotLocked; // disable pivot settings - this._settings[settingsType].hidden = 0; + if (pivotInfo) { + this._settings[settingsType].props = pivotInfo; + this._settings[settingsType].locked = isPivotLocked; // disable pivot settings + this._settings[settingsType].hidden = 0; + } + if (this._state.inPivot !== !this._settings[settingsType].hidden) { + this.rightmenu.clearMoreButton(); + this.rightmenu.btnPivot.setVisible(!this._settings[settingsType].hidden); + this.rightmenu.setButtons(); + this.rightmenu.setMoreButton(); + this._state.inPivot = !this._settings[settingsType].hidden; + } } if (SelectedObjects.length<=0 && cellInfo) { // cell is selected diff --git a/apps/spreadsheeteditor/main/app/view/RightMenu.js b/apps/spreadsheeteditor/main/app/view/RightMenu.js index 0eafd7da6c..ff9dedd404 100644 --- a/apps/spreadsheeteditor/main/app/view/RightMenu.js +++ b/apps/spreadsheeteditor/main/app/view/RightMenu.js @@ -241,9 +241,6 @@ define([ this.signatureSettings = new SSE.Views.SignatureSettings(); } - if (mode && mode.canFeaturePivot) - this.btnPivot.setVisible(true); - if (_.isUndefined(this.scroller)) { this.scroller = new Common.UI.Scroller({ el: $(this.el).find('.right-panel'), From 731cb04f3a08e25e5673beb1b959a19976829e43 Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Thu, 12 Dec 2024 21:30:26 +0300 Subject: [PATCH 2/2] [SSE] Move pivot button --- apps/spreadsheeteditor/main/app/template/RightMenu.template | 2 +- apps/spreadsheeteditor/main/app/view/RightMenu.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/spreadsheeteditor/main/app/template/RightMenu.template b/apps/spreadsheeteditor/main/app/template/RightMenu.template index afee84777b..bcf3190017 100644 --- a/apps/spreadsheeteditor/main/app/template/RightMenu.template +++ b/apps/spreadsheeteditor/main/app/template/RightMenu.template @@ -30,9 +30,9 @@ - +
\ No newline at end of file diff --git a/apps/spreadsheeteditor/main/app/view/RightMenu.js b/apps/spreadsheeteditor/main/app/view/RightMenu.js index ff9dedd404..178c660e4f 100644 --- a/apps/spreadsheeteditor/main/app/view/RightMenu.js +++ b/apps/spreadsheeteditor/main/app/view/RightMenu.js @@ -365,7 +365,7 @@ define([ }, setButtons: function () { - var allButtons = [this.btnCell, this.btnTable, this.btnShape, this.btnImage, this.btnChart, this.btnText, this.btnTextArt, this.btnPivot, this.btnSlicer, this.btnSignature]; + var allButtons = [this.btnCell, this.btnTable, this.btnShape, this.btnImage, this.btnChart, this.btnText, this.btnTextArt, this.btnSlicer, this.btnSignature, this.btnPivot]; Common.UI.SideMenu.prototype.setButtons.apply(this, [allButtons]); },