diff --git a/apps/common/main/lib/view/AutoCorrectDialog.js b/apps/common/main/lib/view/AutoCorrectDialog.js index c5cc84398..e81db0802 100644 --- a/apps/common/main/lib/view/AutoCorrectDialog.js +++ b/apps/common/main/lib/view/AutoCorrectDialog.js @@ -65,10 +65,15 @@ define([ '
', '', '', - '', '', + '', + '', + '', '', '', '', '', - '
', + '', '', '
', + '
', + '
', '', @@ -87,7 +92,7 @@ define([ '
', + '', '', '', '', @@ -96,7 +101,6 @@ define([ '
', '
', '', - '
', '' @@ -121,6 +125,17 @@ define([ var $window = this.getChild(); var me = this; + this.chReplaceType = new Common.UI.CheckBox({ + el: $window.findById('#auto-correct-chb-replace-type'), + labelText: this.textReplaceType, + value: Common.Utils.InternalSettings.get(this.appPrefix + "settings-math-correct-replace-type") + }).on('change', function(field, newValue, oldValue, eOpts){ + var checked = (field.getValue()==='checked'); + Common.localStorage.setBool(me.appPrefix + "settings-math-correct-replace-type", checked); + Common.Utils.InternalSettings.set(me.appPrefix + "settings-math-correct-replace-type", checked); + me.api.asc_updateFlagAutoCorrectMathSymbols(checked); + }); + this.onInitList(); // special @@ -408,7 +423,8 @@ define([ textEdit: 'Replace', textDelete: 'Delete', textRestore: 'Restore', - textReset: 'Reset' + textReset: 'Reset', + textReplaceType: 'Replace text as you type' }, Common.Views.AutoCorrectDialog || {})) }); diff --git a/apps/documenteditor/main/app/controller/Main.js b/apps/documenteditor/main/app/controller/Main.js index 71728ea70..76abb6a94 100644 --- a/apps/documenteditor/main/app/controller/Main.js +++ b/apps/documenteditor/main/app/controller/Main.js @@ -1061,7 +1061,10 @@ define([ value = Common.localStorage.getItem("de-settings-math-correct-rem"); Common.Utils.InternalSettings.set("de-settings-math-correct-rem", value); var arrRem = value ? JSON.parse(value) : []; - me.api.asc_refreshOnStartAutoCorrectMathSymbols(arrRem, arrAdd, true); + value = Common.localStorage.getBool("de-settings-math-correct-replace-type", true); // replace on type + Common.Utils.InternalSettings.set("de-settings-math-correct-replace-type", value); + + me.api.asc_refreshOnStartAutoCorrectMathSymbols(arrRem, arrAdd, value); if (me.needToUpdateVersion) Common.NotificationCenter.trigger('api:disconnect');