Merge pull request #1249 from ONLYOFFICE/feature/table-templates
[DE][PE] Refactoring table templates loading
This commit is contained in:
commit
187c3f350f
|
@ -232,7 +232,7 @@ define([
|
||||||
setApi: function(o) {
|
setApi: function(o) {
|
||||||
this.api = o;
|
this.api = o;
|
||||||
if (o) {
|
if (o) {
|
||||||
this.api.asc_registerCallback('asc_onInitTableTemplates', _.bind(this._onInitTemplates, this));
|
this.api.asc_registerCallback('asc_onInitTableTemplates', _.bind(this.onInitTableTemplates, this));
|
||||||
}
|
}
|
||||||
return this;
|
return this;
|
||||||
},
|
},
|
||||||
|
@ -240,7 +240,7 @@ define([
|
||||||
createDelayedControls: function() {
|
createDelayedControls: function() {
|
||||||
var me = this;
|
var me = this;
|
||||||
|
|
||||||
this._tableTemplates && this._onInitTemplates(this._tableTemplates);
|
this._tableTemplates && this._onInitTemplates();
|
||||||
|
|
||||||
this.chHeader = new Common.UI.CheckBox({
|
this.chHeader = new Common.UI.CheckBox({
|
||||||
el: $('#table-checkbox-header'),
|
el: $('#table-checkbox-header'),
|
||||||
|
@ -730,12 +730,16 @@ define([
|
||||||
!this.btnBorderColor.isAutoColor() && this.btnBorderColor.setColor(this.borderColor.getColor());
|
!this.btnBorderColor.isAutoColor() && this.btnBorderColor.setColor(this.borderColor.getColor());
|
||||||
},
|
},
|
||||||
|
|
||||||
_onInitTemplates: function(Templates){
|
onInitTableTemplates: function(){
|
||||||
if (this._initSettings) {
|
if (this._initSettings) {
|
||||||
this._tableTemplates = Templates;
|
this._tableTemplates = true;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
this._onInitTemplates();
|
||||||
|
},
|
||||||
|
|
||||||
|
_onInitTemplates: function(){
|
||||||
|
var Templates = this.api.asc_getTableStylesPreviews();
|
||||||
var self = this;
|
var self = this;
|
||||||
this._isTemplatesChanged = true;
|
this._isTemplatesChanged = true;
|
||||||
|
|
||||||
|
|
|
@ -219,7 +219,7 @@ define([
|
||||||
setApi: function(o) {
|
setApi: function(o) {
|
||||||
this.api = o;
|
this.api = o;
|
||||||
if (o) {
|
if (o) {
|
||||||
this.api.asc_registerCallback('asc_onInitTableTemplates', _.bind(this._onInitTemplates, this));
|
this.api.asc_registerCallback('asc_onInitTableTemplates', _.bind(this.onInitTableTemplates, this));
|
||||||
}
|
}
|
||||||
return this;
|
return this;
|
||||||
},
|
},
|
||||||
|
@ -227,7 +227,7 @@ define([
|
||||||
createDelayedControls: function() {
|
createDelayedControls: function() {
|
||||||
var me = this;
|
var me = this;
|
||||||
|
|
||||||
this._tableTemplates && this._onInitTemplates(this._tableTemplates);
|
this._tableTemplates && this._onInitTemplates();
|
||||||
|
|
||||||
this.chHeader = new Common.UI.CheckBox({
|
this.chHeader = new Common.UI.CheckBox({
|
||||||
el: $('#table-checkbox-header'),
|
el: $('#table-checkbox-header'),
|
||||||
|
@ -671,12 +671,16 @@ define([
|
||||||
!this.btnBorderColor.isAutoColor() && this.btnBorderColor.setColor(this.borderColor.getColor());
|
!this.btnBorderColor.isAutoColor() && this.btnBorderColor.setColor(this.borderColor.getColor());
|
||||||
},
|
},
|
||||||
|
|
||||||
_onInitTemplates: function(Templates){
|
onInitTableTemplates: function(){
|
||||||
if (this._initSettings) {
|
if (this._initSettings) {
|
||||||
this._tableTemplates = Templates;
|
this._tableTemplates = true;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
this._onInitTemplates();
|
||||||
|
},
|
||||||
|
|
||||||
|
_onInitTemplates: function(){
|
||||||
|
var Templates = this.api.asc_getTableStylesPreviews();
|
||||||
var self = this;
|
var self = this;
|
||||||
this._isTemplatesChanged = true;
|
this._isTemplatesChanged = true;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue