Store overwrite when adding a new batch of templates.
This commit is contained in:
Alexei Koshelev 2022-08-12 01:27:40 +03:00
parent 4ab46feb43
commit 5a9016928c
3 changed files with 24 additions and 16 deletions

View file

@ -350,6 +350,10 @@
position: static;
}
.view .dataview, .dropdown-menu {
padding: 1px;
}
.dataview {
.item {
&:hover {

View file

@ -784,9 +784,15 @@ define([
{id: 'menu-table-group-no-name', caption: '&nbsp', templates: []},
];
self.mnuTableTemplatePicker.store.models.forEach(function(template) {
groups.filter(function(item){ return item.id == template.attributes.group; })[0].templates.push(template);
});
if (this._state.beginPreviewStyles) {
this._state.beginPreviewStyles = false;
}
else {
self.mnuTableTemplatePicker.store.each(function(template) {
groups.filter(function(item){ return item.id == template.get('group') ; })[0].templates.push(template);
});
}
_.each(Templates, function(template){
var tip = template.asc_getDisplayName();
var groupItem = '';
@ -837,10 +843,6 @@ define([
delete item.templates;
});
if (this._state.beginPreviewStyles) {
this._state.beginPreviewStyles = false;
}
self.mnuTableTemplatePicker && self.mnuTableTemplatePicker.groups.reset(groups);
self.mnuTableTemplatePicker && self.mnuTableTemplatePicker.store.reset(templates);
!this._state.currentStyleFound && this.selectCurrentTableStyle();

View file

@ -717,9 +717,15 @@ define([
{id: 'menu-table-group-no-name', caption: '&nbsp', templates: []},
];
self.mnuTableTemplatePicker.store.models.forEach(function(template) {
groups.filter(function(item){ return item.id == template.attributes.group; })[0].templates.push(template);
});
if (this._state.beginPreviewStyles) {
this._state.beginPreviewStyles = false;
}
else {
self.mnuTableTemplatePicker.store.each(function(template) {
groups.filter(function(item){ return item.id == template.get('group') ; })[0].templates.push(template);
});
}
_.each(Templates, function(template){
var tip = template.asc_getDisplayName();
var groupItem = '';
@ -767,10 +773,6 @@ define([
delete item.templates;
});
if (this._state.beginPreviewStyles) {
this._state.beginPreviewStyles = false;
}
self.mnuTableTemplatePicker && self.mnuTableTemplatePicker.groups.reset(groups);
self.mnuTableTemplatePicker && self.mnuTableTemplatePicker.store.reset(templates);
!this._state.currentStyleFound && this.selectCurrentTableStyle();