[SSE] Fix pivot table styles on "more" toolbar panel

This commit is contained in:
Julia Radzhabova 2022-01-12 23:44:22 +03:00
parent b8ccb8533f
commit d40f2cfaf1
2 changed files with 13 additions and 0 deletions

View file

@ -512,6 +512,7 @@ define([
btnsMore[tab].render(box.find('.slot-btn-more')); btnsMore[tab].render(box.find('.slot-btn-more'));
btnsMore[tab].on('toggle', function(btn, state, e) { btnsMore[tab].on('toggle', function(btn, state, e) {
(state) ? me.onMoreShow(btn, e) : me.onMoreHide(btn, e); (state) ? me.onMoreShow(btn, e) : me.onMoreHide(btn, e);
Common.NotificationCenter.trigger('more:toggle', btn, state);
}); });
var moreContainer = $('<div class="dropdown-menu more-container" data-tab="' + tab + '"><div style="display: inline;"></div></div>'); var moreContainer = $('<div class="dropdown-menu more-container" data-tab="' + tab + '"><div style="display: inline;"></div></div>');
optsFold.$bar.append(moreContainer); optsFold.$bar.append(moreContainer);

View file

@ -87,6 +87,7 @@ define([
Common.NotificationCenter.on('app:ready', this.onAppReady.bind(this)); Common.NotificationCenter.on('app:ready', this.onAppReady.bind(this));
Common.NotificationCenter.on('api:disconnect', _.bind(this.SetDisabled, this)); Common.NotificationCenter.on('api:disconnect', _.bind(this.SetDisabled, this));
Common.NotificationCenter.on('more:toggle', _.bind(this.onMoreToggle, this));
}, },
setConfig: function (config) { setConfig: function (config) {
@ -426,6 +427,17 @@ define([
}); });
}, },
onMoreToggle: function(btn, state, e) {
if (this.view && this.view.toolbar && this.view.toolbar.isTabActive('pivot') && state) {
var styles = this.view.pivotStyles;
if (styles && styles.needFillComboView && styles.menuPicker.store.length > 0 && styles.rendered){
var styleRec;
if (this._state.TemplateName) styleRec = styles.menuPicker.store.findWhere({name: this._state.TemplateName});
styles.fillComboView((styleRec) ? styleRec : styles.menuPicker.store.at(0), true);
}
}
},
strSheet : 'Sheet' strSheet : 'Sheet'
}, SSE.Controllers.PivotTable || {})); }, SSE.Controllers.PivotTable || {}));