Skip to content

Commit

Permalink
Merge pull request 'feature/sse-hide-pivot-btn' (#176) from feature/s…
Browse files Browse the repository at this point in the history
…se-hide-pivot-btn into release/v8.3.0
  • Loading branch information
Julia Radzhabova committed Dec 12, 2024
2 parents 7e748a9 + 731cb04 commit 45367eb
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 11 deletions.
9 changes: 8 additions & 1 deletion apps/common/main/lib/component/SideMenu.js
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand All @@ -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);
}
},
Expand Down
19 changes: 14 additions & 5 deletions apps/spreadsheeteditor/main/app/controller/RightMenu.js
Original file line number Diff line number Diff line change
Expand Up @@ -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': {
Expand Down Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@
<button id="id-right-menu-chart" class="btn btn-category arrow-left" data-hint="0" data-hint-direction="left" data-hint-offset="big" content-target="id-chart-settings"><i class="icon toolbar__icon btn-menu-chart">&nbsp;</i></button>
<button id="id-right-menu-text" class="btn btn-category arrow-left" data-hint="0" data-hint-direction="left" data-hint-offset="big" content-target="id-paragraph-settings"><i class="icon toolbar__icon btn-paragraph">&nbsp;</i></button>
<button id="id-right-menu-textart" class="btn btn-category arrow-left" data-hint="0" data-hint-direction="left" data-hint-offset="big" content-target="id-textart-settings"><i class="icon toolbar__icon btn-menu-textart">&nbsp;</i></button>
<button id="id-right-menu-pivot" class="btn btn-category arrow-left" data-hint="0" data-hint-direction="left" data-hint-offset="big" content-target="id-pivot-settings"><i class="icon toolbar__icon btn-pivot-sum">&nbsp;</i></button>
<button id="id-right-menu-slicer" class="btn btn-category arrow-left" data-hint="0" data-hint-direction="left" data-hint-offset="big" content-target="id-slicer-settings"><i class="icon toolbar__icon btn-slicer">&nbsp;</i></button>
<button id="id-right-menu-signature" class="btn btn-category arrow-left hidden" data-hint="0" data-hint-direction="left" data-hint-offset="big" content-target="id-signature-settings"><i class="icon toolbar__icon btn-menu-signature">&nbsp;</i></button>
<button id="id-right-menu-pivot" class="btn btn-category arrow-left" data-hint="0" data-hint-direction="left" data-hint-offset="big" content-target="id-pivot-settings"><i class="icon toolbar__icon btn-pivot-sum">&nbsp;</i></button>
<div id="slot-right-menu-more"></div>
</div>
</div>
5 changes: 1 addition & 4 deletions apps/spreadsheeteditor/main/app/view/RightMenu.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'),
Expand Down Expand Up @@ -368,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]);
},

Expand Down

0 comments on commit 45367eb

Please sign in to comment.