From 95df34aae29e1bf609cb4e67be33cb8158d330dc Mon Sep 17 00:00:00 2001 From: Konstantin Kireyev Date: Mon, 22 Jul 2024 15:04:34 +0500 Subject: [PATCH] fix/[se]: spellcheck don't work in view mode --- .../main/app/controller/Spellcheck.js | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/apps/spreadsheeteditor/main/app/controller/Spellcheck.js b/apps/spreadsheeteditor/main/app/controller/Spellcheck.js index f44b9768d9..11dc74553e 100644 --- a/apps/spreadsheeteditor/main/app/controller/Spellcheck.js +++ b/apps/spreadsheeteditor/main/app/controller/Spellcheck.js @@ -41,11 +41,8 @@ define([ SSE.Controllers.Spellcheck = Backbone.Controller.extend(_.extend({ models: [], - collections: [ - ], - views: [ - // 'Spellcheck' - ], + collections: [], + views: [], initialize: function() { var me = this; @@ -66,8 +63,6 @@ define([ } } }); - - Common.NotificationCenter.on('script:loaded', _.bind(this.onPostLoadComplete, this)); }, events: function() { @@ -76,6 +71,7 @@ define([ onLaunch: function() { this._isDisabled = false; this._initSettings = true; + Common.NotificationCenter.on('script:loaded', _.bind(this.onPostLoadComplete, this)); }, onPostLoadComplete: function() { @@ -84,7 +80,9 @@ define([ this.panelSpellcheck.on('render:after', _.bind(this.onAfterRender, this)); Common.NotificationCenter.trigger('script:loaded:spellcheck'); - this.api.asc_registerCallback('asc_onSpellCheckVariantsFound', _.bind(this.onSpellCheckVariantsFound, this)); + if (this.api) { + this.api.asc_registerCallback('asc_onSpellCheckVariantsFound', _.bind(this.onSpellCheckVariantsFound, this)); + } }, setApi: function(api) {