diff --git a/apps/spreadsheeteditor/main/app/controller/FormulaDialog.js b/apps/spreadsheeteditor/main/app/controller/FormulaDialog.js index 98a7285a3..29cf784bc 100644 --- a/apps/spreadsheeteditor/main/app/controller/FormulaDialog.js +++ b/apps/spreadsheeteditor/main/app/controller/FormulaDialog.js @@ -69,8 +69,6 @@ define([ this.addListeners({ 'FileMenu': { 'settings:apply': function() { - if (!me.mode || !me.mode.isEdit) return; - me.needUpdateFormula = true; var lang = Common.localStorage.getItem("sse-settings-func-locale"); @@ -116,13 +114,13 @@ define([ setApi: function (api) { this.api = api; - this.api.asc_registerCallback('asc_onSendFunctionWizardInfo', _.bind(this.onSendFunctionWizardInfo, this)); - if (this.formulasGroups && this.api) { + if (this.formulasGroups) { Common.Utils.InternalSettings.set("sse-settings-func-last", Common.localStorage.getItem("sse-settings-func-last")); - this.reloadTranslations(Common.localStorage.getItem("sse-settings-func-locale") || this.appOptions.lang, true); + if (!this.mode.isEdit) return; + var me = this; this.formulas = new SSE.Views.FormulaDialog({ @@ -140,6 +138,7 @@ define([ } this.formulaTab && this.formulaTab.setApi(this.api); + this.api.asc_registerCallback('asc_onSendFunctionWizardInfo', _.bind(this.onSendFunctionWizardInfo, this)); return this; }, @@ -193,6 +192,8 @@ define([ }); } + if (!this.mode.isEdit) return; + if (me.langDescJson[lang]) me.loadingFormulas(me.langDescJson[lang], suppressEvent); else { diff --git a/apps/spreadsheeteditor/main/app/controller/Main.js b/apps/spreadsheeteditor/main/app/controller/Main.js index 3149428d4..2ea022ec5 100644 --- a/apps/spreadsheeteditor/main/app/controller/Main.js +++ b/apps/spreadsheeteditor/main/app/controller/Main.js @@ -1006,6 +1006,8 @@ define([ } }, 50); } else { + var formulasDlgController = application.getController('FormulaDialog'); + formulasDlgController && formulasDlgController.setMode(me.appOptions).setApi(me.api); documentHolderView.createDelayedElementsViewer(); Common.NotificationCenter.trigger('document:ready', 'main'); me.applyLicense(); diff --git a/apps/spreadsheeteditor/main/app/view/FileMenuPanels.js b/apps/spreadsheeteditor/main/app/view/FileMenuPanels.js index eb2605b7b..8550c804b 100644 --- a/apps/spreadsheeteditor/main/app/view/FileMenuPanels.js +++ b/apps/spreadsheeteditor/main/app/view/FileMenuPanels.js @@ -271,7 +271,7 @@ define([ '