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; position: static;
} }
.view .dataview, .dropdown-menu {
padding: 1px;
}
.dataview { .dataview {
.item { .item {
&:hover { &:hover {

View file

@ -784,9 +784,15 @@ define([
{id: 'menu-table-group-no-name', caption: '&nbsp', templates: []}, {id: 'menu-table-group-no-name', caption: '&nbsp', templates: []},
]; ];
self.mnuTableTemplatePicker.store.models.forEach(function(template) { if (this._state.beginPreviewStyles) {
groups.filter(function(item){ return item.id == template.attributes.group; })[0].templates.push(template); 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){ _.each(Templates, function(template){
var tip = template.asc_getDisplayName(); var tip = template.asc_getDisplayName();
var groupItem = ''; var groupItem = '';
@ -836,11 +842,7 @@ define([
templates = templates.concat(item.templates); templates = templates.concat(item.templates);
delete item.templates; delete item.templates;
}); });
if (this._state.beginPreviewStyles) {
this._state.beginPreviewStyles = false;
}
self.mnuTableTemplatePicker && self.mnuTableTemplatePicker.groups.reset(groups); self.mnuTableTemplatePicker && self.mnuTableTemplatePicker.groups.reset(groups);
self.mnuTableTemplatePicker && self.mnuTableTemplatePicker.store.reset(templates); self.mnuTableTemplatePicker && self.mnuTableTemplatePicker.store.reset(templates);
!this._state.currentStyleFound && this.selectCurrentTableStyle(); !this._state.currentStyleFound && this.selectCurrentTableStyle();

View file

@ -717,9 +717,15 @@ define([
{id: 'menu-table-group-no-name', caption: '&nbsp', templates: []}, {id: 'menu-table-group-no-name', caption: '&nbsp', templates: []},
]; ];
self.mnuTableTemplatePicker.store.models.forEach(function(template) { if (this._state.beginPreviewStyles) {
groups.filter(function(item){ return item.id == template.attributes.group; })[0].templates.push(template); 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){ _.each(Templates, function(template){
var tip = template.asc_getDisplayName(); var tip = template.asc_getDisplayName();
var groupItem = ''; var groupItem = '';
@ -766,11 +772,7 @@ define([
templates = templates.concat(item.templates); templates = templates.concat(item.templates);
delete item.templates; delete item.templates;
}); });
if (this._state.beginPreviewStyles) {
this._state.beginPreviewStyles = false;
}
self.mnuTableTemplatePicker && self.mnuTableTemplatePicker.groups.reset(groups); self.mnuTableTemplatePicker && self.mnuTableTemplatePicker.groups.reset(groups);
self.mnuTableTemplatePicker && self.mnuTableTemplatePicker.store.reset(templates); self.mnuTableTemplatePicker && self.mnuTableTemplatePicker.store.reset(templates);
!this._state.currentStyleFound && this.selectCurrentTableStyle(); !this._state.currentStyleFound && this.selectCurrentTableStyle();