diff --git a/apps/spreadsheeteditor/main/app/controller/LeftMenu.js b/apps/spreadsheeteditor/main/app/controller/LeftMenu.js index c18f73f3c..5720d7559 100644 --- a/apps/spreadsheeteditor/main/app/controller/LeftMenu.js +++ b/apps/spreadsheeteditor/main/app/controller/LeftMenu.js @@ -75,6 +75,7 @@ define([ 'saveas:format': _.bind(this.clickSaveAsFormat, this), 'savecopy:format': _.bind(this.clickSaveCopyAsFormat, this), 'settings:apply': _.bind(this.applySettings, this), + 'spellcheck:apply': _.bind(this.applySpellcheckSettings, this), 'create:new': _.bind(this.onCreateNew, this), 'recent:open': _.bind(this.onOpenRecent, this) }, @@ -394,6 +395,23 @@ define([ this.leftMenu.fireEvent('settings:apply'); }, + applySpellcheckSettings: function(menu) { + if (this.mode.isEdit && this.api) { + var value = Common.localStorage.getBool("sse-spellcheck-ignore-uppercase-words"); + this.api.asc_ignoreUppercase(value); + value = Common.localStorage.getBool("sse-spellcheck-ignore-numbers-words"); + this.api.asc_ignoreNumbers(value); + value = Common.localStorage.getItem("sse-spellcheck-locale"); + if (value) { + this.api.asc_setDefaultLanguage(parseInt(value)); + } + } + + menu.hide(); + + this.leftMenu.fireEvent('spellcheck:update'); + }, + onCreateNew: function(menu, type) { if ( !Common.Controllers.Desktop.process('create:new') ) { var newDocumentPage = window.open(type == 'blank' ? this.mode.createUrl : type, "_blank"); diff --git a/apps/spreadsheeteditor/main/app/controller/Main.js b/apps/spreadsheeteditor/main/app/controller/Main.js index 196cf3475..7c6b90c7d 100644 --- a/apps/spreadsheeteditor/main/app/controller/Main.js +++ b/apps/spreadsheeteditor/main/app/controller/Main.js @@ -93,8 +93,7 @@ define([ initialize: function() { this.addListeners({ 'FileMenu': { - 'settings:apply': _.bind(this.applySettings, this), - 'spellcheck:apply': _.bind(this.applySpellcheckSettings, this) + 'settings:apply': _.bind(this.applySettings, this) }, 'Common.Views.ReviewChanges': { 'settings:apply': _.bind(this.applySettings, this) @@ -2050,19 +2049,6 @@ define([ } }, - applySpellcheckSettings: function() { - if (this.appOptions.isEdit && !this.appOptions.isOffline && this.appOptions.canCoAuthoring && this.api) { - var value = Common.localStorage.getBool("sse-spellcheck-ignore-uppercase-words"); - this.api.asc_ignoreUppercase(value); - value = Common.localStorage.getBool("sse-spellcheck-ignore-numbers-words"); - this.api.asc_ignoreNumbers(value); - value = Common.localStorage.getItem("sse-spellcheck-locale"); - if (value) { - this.api.asc_setDefaultLanguage(parseInt(value)); - } - } - }, - onDocumentName: function(name) { this.headerView.setDocumentCaption(name); this.updateWindowTitle(this.api.asc_isDocumentModified(), true); diff --git a/apps/spreadsheeteditor/main/app/controller/Spellcheck.js b/apps/spreadsheeteditor/main/app/controller/Spellcheck.js index 227351747..b51b8b3ce 100644 --- a/apps/spreadsheeteditor/main/app/controller/Spellcheck.js +++ b/apps/spreadsheeteditor/main/app/controller/Spellcheck.js @@ -61,7 +61,12 @@ define([ 'hide': function() { me.api && me.api.asc_cancelSpellCheck(); } - } + }, + 'LeftMenu': { + 'spellcheck:update': function () { + me.updateLanguages(); + } + }, }); },