From e436fe38761551d33cc2b1c025191775860c7f47 Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Wed, 8 Sep 2021 19:26:02 +0300 Subject: [PATCH] Refactoring table templates rendering --- apps/documenteditor/main/app/view/TableSettings.js | 7 +++++++ apps/presentationeditor/main/app/view/TableSettings.js | 7 +++++++ apps/spreadsheeteditor/main/app/view/ChartSettings.js | 3 ++- 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/apps/documenteditor/main/app/view/TableSettings.js b/apps/documenteditor/main/app/view/TableSettings.js index ccef63270..bf31a827b 100644 --- a/apps/documenteditor/main/app/view/TableSettings.js +++ b/apps/documenteditor/main/app/view/TableSettings.js @@ -240,6 +240,8 @@ define([ createDelayedControls: function() { var me = this; + this._tableTemplates && this._onInitTemplates(this._tableTemplates); + this.chHeader = new Common.UI.CheckBox({ el: $('#table-checkbox-header'), labelText: this.textHeader, @@ -729,6 +731,11 @@ define([ }, _onInitTemplates: function(Templates){ + if (this._initSettings) { + this._tableTemplates = Templates; + return; + } + var self = this; this._isTemplatesChanged = true; diff --git a/apps/presentationeditor/main/app/view/TableSettings.js b/apps/presentationeditor/main/app/view/TableSettings.js index 56ffc1f02..f0ef9c70c 100644 --- a/apps/presentationeditor/main/app/view/TableSettings.js +++ b/apps/presentationeditor/main/app/view/TableSettings.js @@ -227,6 +227,8 @@ define([ createDelayedControls: function() { var me = this; + this._tableTemplates && this._onInitTemplates(this._tableTemplates); + this.chHeader = new Common.UI.CheckBox({ el: $('#table-checkbox-header'), labelText: this.textHeader, @@ -670,6 +672,11 @@ define([ }, _onInitTemplates: function(Templates){ + if (this._initSettings) { + this._tableTemplates = Templates; + return; + } + var self = this; this._isTemplatesChanged = true; diff --git a/apps/spreadsheeteditor/main/app/view/ChartSettings.js b/apps/spreadsheeteditor/main/app/view/ChartSettings.js index ffd4d5e0d..08471ce4c 100644 --- a/apps/spreadsheeteditor/main/app/view/ChartSettings.js +++ b/apps/spreadsheeteditor/main/app/view/ChartSettings.js @@ -685,7 +685,8 @@ define([ allowScrollbar: false, groups: new Common.UI.DataViewGroupStore(Common.define.chartData.getSparkGroupData()), store: new Common.UI.DataViewStore(Common.define.chartData.getSparkData()), - itemTemplate: _.template('
\">
') + itemTemplate: _.template('
\">
'), + delayRenderTips: true }); }); this.btnSparkType.render($('#spark-button-type'));