[SSE] Use asc_onSendFunctionWizardInfo for adding formula

This commit is contained in:
Julia Radzhabova 2020-04-17 17:04:52 +03:00
parent b8cd3a4054
commit db20478e15

View file

@ -95,7 +95,7 @@ define([
if (func.origin === 'more') { if (func.origin === 'more') {
this.showDialog(group); this.showDialog(group);
} else { } 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); !autocomplete && this.updateLast10Formulas(func.origin);
} }
} }
@ -112,6 +112,7 @@ define([
setApi: function (api) { setApi: function (api) {
this.api = api; this.api = api;
this.api.asc_registerCallback('asc_onSendFunctionWizardInfo', _.bind(this.onSendFunctionWizardInfo, this));
if (this.formulasGroups && this.api) { if (this.formulasGroups && this.api) {
Common.Utils.InternalSettings.set("sse-settings-func-last", Common.localStorage.getItem("sse-settings-func-last")); 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.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 () { hideDialog: function () {
if (this.formulas && this.formulas.isVisible()) { if (this.formulas && this.formulas.isVisible()) {
this.formulas.hide(); this.formulas.hide();