Skip to content

Commit 96f6e30

Browse files
committed
Make assistive-mml unset speech/braille and vice-versa
1 parent e8bfee1 commit 96f6e30

1 file changed

Lines changed: 20 additions & 0 deletions

File tree

ts/ui/menu/Menu.ts

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1180,6 +1180,16 @@ export class Menu {
11801180
*/
11811181
protected setAssistiveMml(mml: boolean) {
11821182
this.document.options.enableAssistiveMml = mml;
1183+
if (mml) {
1184+
Menu.loading++; // pretend we're loading, to suppress rerendering for each variable change
1185+
if (this.settings.speech) {
1186+
this.menu.pool.lookup('speech').setValue(false);
1187+
}
1188+
if (this.settings.braille) {
1189+
this.menu.pool.lookup('braille').setValue(false);
1190+
}
1191+
Menu.loading--;
1192+
}
11831193
if (!mml || MathJax._?.a11y?.['assistive-mml']) {
11841194
this.rerender();
11851195
} else {
@@ -1213,6 +1223,11 @@ export class Menu {
12131223
protected setSpeech(speech: boolean) {
12141224
this.enableAccessibilityItems('Speech', speech);
12151225
this.document.options.enableSpeech = speech;
1226+
if (speech && this.settings.assistiveMml) {
1227+
Menu.loading++; // pretend we're loading, to suppress rerendering for each variable change
1228+
this.menu.pool.lookup('assistiveMml').setValue(false);
1229+
Menu.loading--;
1230+
}
12161231
if (!speech || MathJax._?.a11y?.explorer) {
12171232
this.rerender(STATE.COMPILED);
12181233
} else {
@@ -1226,6 +1241,11 @@ export class Menu {
12261241
protected setBraille(braille: boolean) {
12271242
this.enableAccessibilityItems('Braille', braille);
12281243
this.document.options.enableBraille = braille;
1244+
if (braille && this.settings.assistiveMml) {
1245+
Menu.loading++; // pretend we're loading, to suppress rerendering for each variable change
1246+
this.menu.pool.lookup('assistiveMml').setValue(false);
1247+
Menu.loading--;
1248+
}
12291249
if (!braille || MathJax._?.a11y?.explorer) {
12301250
this.rerender(STATE.COMPILED);
12311251
} else {

0 commit comments

Comments
 (0)