Skip to content

Commit 3801c54

Browse files
committed
Use variable() for speechRules definition
1 parent 586ee79 commit 3801c54

File tree

1 file changed

+6
-14
lines changed

1 file changed

+6
-14
lines changed

ts/ui/menu/Menu.ts

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -507,20 +507,12 @@ export class Menu {
507507
this.a11yVar<boolean>('viewBraille'),
508508
this.a11yVar<boolean>('voicing'),
509509
this.a11yVar<string>('locale', locale => this.setLocale(locale)),
510-
{
511-
name: 'speechRules',
512-
getter: () => {
513-
return this.settings['speechRules'];
514-
},
515-
setter: (value: string) => {
516-
const [domain, style] = value.split('-');
517-
this.settings['speechRules'] = value;
518-
this.document.options.sre.domain = domain;
519-
this.document.options.sre.style = style;
520-
this.rerender(STATE.COMPILED);
521-
this.saveUserSettings();
522-
}
523-
},
510+
this.variable<string>('speechRules', value => {
511+
const [domain, style] = value.split('-');
512+
this.document.options.sre.domain = domain;
513+
this.document.options.sre.style = style;
514+
this.rerender(STATE.COMPILED);
515+
}),
524516
this.a11yVar<string> ('magnification'),
525517
this.a11yVar<string> ('magnify'),
526518
this.a11yVar<boolean>('treeColoring'),

0 commit comments

Comments
 (0)