diff --git a/apps/common/main/lib/component/Mixtbar.js b/apps/common/main/lib/component/Mixtbar.js index 0091090e0..411620f91 100644 --- a/apps/common/main/lib/component/Mixtbar.js +++ b/apps/common/main/lib/component/Mixtbar.js @@ -512,6 +512,7 @@ define([ btnsMore[tab].render(box.find('.slot-btn-more')); btnsMore[tab].on('toggle', function(btn, state, e) { (state) ? me.onMoreShow(btn, e) : me.onMoreHide(btn, e); + Common.NotificationCenter.trigger('more:toggle', btn, state); }); var moreContainer = $(''); optsFold.$bar.append(moreContainer); diff --git a/apps/spreadsheeteditor/main/app/controller/PivotTable.js b/apps/spreadsheeteditor/main/app/controller/PivotTable.js index 3b1cba876..26480558d 100644 --- a/apps/spreadsheeteditor/main/app/controller/PivotTable.js +++ b/apps/spreadsheeteditor/main/app/controller/PivotTable.js @@ -87,6 +87,7 @@ define([ Common.NotificationCenter.on('app:ready', this.onAppReady.bind(this)); Common.NotificationCenter.on('api:disconnect', _.bind(this.SetDisabled, this)); + Common.NotificationCenter.on('more:toggle', _.bind(this.onMoreToggle, this)); }, 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' }, SSE.Controllers.PivotTable || {}));