Use Electron Spellchecker

This commit is contained in:
Ken Powers 2020-03-20 17:00:11 -04:00 committed by Scott Nonnenberg
parent 42152be4af
commit 4a8f5db0a4
15 changed files with 195 additions and 381 deletions

View file

@ -106,7 +106,17 @@
el: this.$('.spell-check-setting'),
name: 'spell-check-setting',
value: window.initialData.spellCheck,
setFn: window.setSpellCheck,
setFn: val => {
const $msg = this.$('.spell-check-setting-message');
if (val !== window.appStartInitialSpellcheckSetting) {
$msg.show();
$msg.attr('aria-hidden', false);
} else {
$msg.hide();
$msg.attr('aria-hidden', true);
}
window.setSpellCheck(val);
},
});
if (Settings.isHideMenuBarSupported()) {
new CheckboxView({
@ -131,6 +141,10 @@
'click .clear-data': 'onClearData',
},
render_attributes() {
const spellCheckDirty =
window.initialData.spellCheck !==
window.appStartInitialSpellcheckSetting;
return {
deviceNameLabel: i18n('deviceName'),
deviceName: window.initialData.deviceName,
@ -157,6 +171,9 @@
mediaPermissionsDescription: i18n('mediaPermissionsDescription'),
generalHeader: i18n('general'),
spellCheckDescription: i18n('spellCheckDescription'),
spellCheckHidden: spellCheckDirty ? 'false' : 'true',
spellCheckDisplay: spellCheckDirty ? 'inherit' : 'none',
spellCheckDirtyText: i18n('spellCheckDirty'),
};
},
onClose() {