Fix Bug
Store overwrite when adding a new batch of templates.
This commit is contained in:
parent
4ab46feb43
commit
5a9016928c
|
@ -350,6 +350,10 @@
|
|||
position: static;
|
||||
}
|
||||
|
||||
.view .dataview, .dropdown-menu {
|
||||
padding: 1px;
|
||||
}
|
||||
|
||||
.dataview {
|
||||
.item {
|
||||
&:hover {
|
||||
|
|
|
@ -784,9 +784,15 @@ define([
|
|||
{id: 'menu-table-group-no-name', caption: ' ', 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 = '';
|
||||
|
@ -836,11 +842,7 @@ define([
|
|||
templates = templates.concat(item.templates);
|
||||
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();
|
||||
|
|
|
@ -717,9 +717,15 @@ define([
|
|||
{id: 'menu-table-group-no-name', caption: ' ', 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 = '';
|
||||
|
@ -766,11 +772,7 @@ define([
|
|||
templates = templates.concat(item.templates);
|
||||
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();
|
||||
|
|
Loading…
Reference in a new issue