[SSE] Fix styles updating

This commit is contained in:
Julia Radzhabova 2020-09-17 16:29:48 +03:00
parent 1448308bcd
commit a4965064eb
3 changed files with 32 additions and 4 deletions

View file

@ -65,7 +65,8 @@ define([
'pivottable:layout': _.bind(this.onPivotLayout, this),
'pivottable:blankrows': _.bind(this.onPivotBlankRows, this),
'pivottable:subtotals': _.bind(this.onPivotSubtotals, this),
'pivottable:grandtotals': _.bind(this.onPivotGrandTotals, this)
'pivottable:grandtotals': _.bind(this.onPivotGrandTotals, this),
'pivot:open': _.bind(this.onPivotOpen, this)
},
'TableSettings': {
'pivottable:create': _.bind(this.onCreateClick, this)
@ -332,9 +333,9 @@ define([
if (this._isTemplatesChanged) {
if (rec)
view.pivotStyles.fillComboView(view.pivotStyles.menuPicker.getSelectedRec(),true, true);
view.pivotStyles.fillComboView(view.pivotStyles.menuPicker.getSelectedRec(),true);
else
view.pivotStyles.fillComboView(view.pivotStyles.menuPicker.store.at(0), true, true);
view.pivotStyles.fillComboView(view.pivotStyles.menuPicker.store.at(0), true);
}
this._state.TemplateName=value;
}
@ -363,6 +364,7 @@ define([
data[index].model.set('imageUrl', img, {silent: true});
$(data[index].el).find('img').attr('src', img);
});
styles.fieldPicker.store.reset(styles.fieldPicker.store.models);
} else {
styles.menuPicker.store.reset([]);
var arr = [];
@ -382,6 +384,15 @@ define([
}
},
onPivotOpen: function() {
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);
}
},
onSelectionChanged: function(info) {
if (this.rangeSelectionMode || !this.appConfig.isEdit || !this.view) return;

View file

@ -80,7 +80,8 @@ define([
'add:chart' : this.onSelectChart,
'insert:textart': this.onInsertTextart,
'change:scalespn': this.onClickChangeScaleInMenu.bind(me),
'click:customscale': this.onScaleClick.bind(me)
'click:customscale': this.onScaleClick.bind(me),
'home:open' : this.onHomeOpen
},
'FileMenu': {
'menu:hide': me.onFileMenu.bind(me, 'hide'),
@ -1773,6 +1774,15 @@ define([
window.styles_loaded = true;
},
onHomeOpen: function() {
var listStyles = this.toolbar.listStyles;
if (listStyles && listStyles.needFillComboView && listStyles.menuPicker.store.length > 0 && listStyles.rendered){
var styleRec;
if (this._state.prstyle) styleRec = listStyles.menuPicker.store.findWhere({name: this._state.prstyle});
listStyles.fillComboView((styleRec) ? styleRec : listStyles.menuPicker.store.at(0), true);
}
},
onApiCoAuthoringDisconnect: function(enableDownload) {
this.toolbar.setMode({isDisconnected:true, enableDownload: !!enableDownload});
this.editMode = false;

View file

@ -1553,6 +1553,13 @@ define([
me.fireEvent('file:open');
me.setTab(tab);
}
if ( me.isTabActive('home'))
me.fireEvent('home:open');
if ( me.isTabActive('pivot')) {
var pivottab = SSE.getController('PivotTable');
pivottab && pivottab.getView('PivotTable').fireEvent('pivot:open');
}
},
rendererComponents: function(html) {