From db20478e15ab114b01fb2f20b07034435d03a0f7 Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Fri, 17 Apr 2020 17:04:52 +0300 Subject: [PATCH] [SSE] Use asc_onSendFunctionWizardInfo for adding formula --- .../main/app/controller/FormulaDialog.js | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/apps/spreadsheeteditor/main/app/controller/FormulaDialog.js b/apps/spreadsheeteditor/main/app/controller/FormulaDialog.js index 45a977803..caac997fb 100644 --- a/apps/spreadsheeteditor/main/app/controller/FormulaDialog.js +++ b/apps/spreadsheeteditor/main/app/controller/FormulaDialog.js @@ -95,7 +95,7 @@ define([ if (func.origin === 'more') { this.showDialog(group); } else { - this.api.asc_insertFormula(func.name, Asc.c_oAscPopUpSelectorType.Func, !!autocomplete); + this.api.asc_insertFormula(func.name, Asc.c_oAscPopUpSelectorType.Func, !!autocomplete, true); !autocomplete && this.updateLast10Formulas(func.origin); } } @@ -112,6 +112,7 @@ define([ setApi: function (api) { this.api = api; + this.api.asc_registerCallback('asc_onSendFunctionWizardInfo', _.bind(this.onSendFunctionWizardInfo, this)); if (this.formulasGroups && this.api) { Common.Utils.InternalSettings.set("sse-settings-func-last", Common.localStorage.getItem("sse-settings-func-last")); @@ -216,9 +217,20 @@ define([ this.formulas.fillFormulasGroups(); } } - this.formulas.show(group); + this._formulagroup = group; + this.api.asc_preInsertFormula(); } }, + + onSendFunctionWizardInfo: function(props) { + if (props) { + // show formula settings + console.log('show formula settings'); + } else + this.formulas.show(this._formulagroup); + this._formulagroup = undefined; + }, + hideDialog: function () { if (this.formulas && this.formulas.isVisible()) { this.formulas.hide();