From 946794e2597b9de9c406afa4c37f03b9b3a6aa92 Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Thu, 12 Dec 2024 16:25:42 +0300 Subject: [PATCH] [SSE] For Bug 72019 --- .../main/app/controller/FormulaDialog.js | 10 +++++----- apps/spreadsheeteditor/main/app/controller/Main.js | 9 +++++---- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/apps/spreadsheeteditor/main/app/controller/FormulaDialog.js b/apps/spreadsheeteditor/main/app/controller/FormulaDialog.js index 7f6d0c07a7..d26ada4632 100644 --- a/apps/spreadsheeteditor/main/app/controller/FormulaDialog.js +++ b/apps/spreadsheeteditor/main/app/controller/FormulaDialog.js @@ -118,14 +118,14 @@ define([ return this; }, - setApi: function (api) { + setApi: function (api, loadTranslations) { this.api = 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); + this.reloadTranslations(Common.localStorage.getItem("sse-settings-func-locale") || this.appOptions.lang, true, loadTranslations); - if (!this.mode.isEdit) return; + if (!this.mode.isEdit || loadTranslations) return; var me = this; @@ -176,7 +176,7 @@ define([ this.appOptions.lang = data.config.lang; }, - reloadTranslations: function (lang, suppressEvent) { + reloadTranslations: function (lang, suppressEvent, loadTranslations) { this.formulasLoaded = false; lang = (lang || 'en').toLowerCase(); @@ -206,7 +206,7 @@ define([ }); } - if (!this.mode.isEdit) return; + if (!this.mode.isEdit || loadTranslations) return; if (me.langDescJson[lang]) me.loadingFormulas(me.langDescJson[lang], suppressEvent); diff --git a/apps/spreadsheeteditor/main/app/controller/Main.js b/apps/spreadsheeteditor/main/app/controller/Main.js index 74131e3a65..845b40f553 100644 --- a/apps/spreadsheeteditor/main/app/controller/Main.js +++ b/apps/spreadsheeteditor/main/app/controller/Main.js @@ -1125,9 +1125,7 @@ define([ me.onDocumentModifiedChanged(me.api.asc_isDocumentModified()); var formulasDlgController = application.getController('FormulaDialog'); - if (formulasDlgController) { - formulasDlgController.setMode(me.appOptions).setApi(me.api); - } + formulasDlgController && formulasDlgController.setApi(me.api); if (me.needToUpdateVersion) toolbarController.onApiCoAuthoringDisconnect(); @@ -1137,7 +1135,7 @@ define([ }, 50); } else { var formulasDlgController = application.getController('FormulaDialog'); - formulasDlgController && formulasDlgController.setMode(me.appOptions).setApi(me.api); + formulasDlgController && formulasDlgController.setApi(me.api); documentHolderView.createDelayedElementsViewer(); Common.Utils.injectSvgIcons(); Common.NotificationCenter.trigger('document:ready', 'main'); @@ -1655,6 +1653,9 @@ define([ var celleditorController = this.getApplication().getController('CellEditor'); celleditorController && celleditorController.setApi(this.api).setMode(this.appOptions); + + var formulasDlgController = this.getApplication().getController('FormulaDialog'); + formulasDlgController && formulasDlgController.setMode(this.appOptions).setApi(this.api, true); }, applyModeEditorElements: function(prevmode) {