[SSE] Fix styles updating

This commit is contained in:
Julia Radzhabova 2020-09-16 17:43:49 +03:00
parent 3982797116
commit 0669c65b67
2 changed files with 11 additions and 2 deletions

View file

@ -459,6 +459,13 @@ define([
this.menuPicker.selectByIndex(index);
},
selectRecord: function(record) {
if (!record)
this.fieldPicker.deselectAll();
this.menuPicker.selectRecord(record);
},
setItemWidth: function(width) {
if (this.itemWidth != width)
this.itemWidth = window.devicePixelRatio > 1 ? width / 2 : width;

View file

@ -1739,6 +1739,7 @@ define([
return;
}
var rec = listStyles.menuPicker.getSelectedRec();
listStyles.menuPicker.store.reset([]); // remove all
var mainController = this.getApplication().getController('Main');
@ -1752,8 +1753,9 @@ define([
});
if (listStyles.menuPicker.store.length > 0 && listStyles.rendered) {
listStyles.fillComboView(listStyles.menuPicker.store.at(0), true);
listStyles.selectByIndex(0);
rec = rec ? listStyles.menuPicker.store.findWhere({name: rec.get('name')}) : null;
listStyles.fillComboView(rec ? rec : listStyles.menuPicker.store.at(0), true);
rec ? listStyles.selectRecord(rec) : listStyles.selectByIndex(0);
}
window.styles_loaded = true;