Skip to content

Commit 0a18ed5

Browse files
committed
Handle changes to semantic-enrichment properly
1 parent 876c8a6 commit 0a18ed5

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

ts/ui/menu/Menu.ts

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -684,9 +684,6 @@ export class Menu {
684684
menu.setJax(this.jax);
685685
this.attachDialogMenus(menu);
686686
this.checkLoadableItems();
687-
this.enableAccessibilityItems('Speech', this.settings.speech);
688-
this.enableAccessibilityItems('Braille', this.settings.braille);
689-
this.setAccessibilityMenus();
690687
const cache: [string, string][] = [];
691688
MJContextMenu.DynamicSubmenus.set(
692689
'ShowAnnotation',
@@ -832,9 +829,9 @@ export class Menu {
832829
this.setTabOrder(this.settings.inTabOrder);
833830
const options = this.document.options;
834831
options.enableAssistiveMml = this.settings.assistiveMml;
835-
options.enableSpeech = this.settings.speech;
836-
options.enableBraille = this.settings.braille;
837-
options.enableExplorer = this.settings.enrich;
832+
this.enableAccessibilityItems('Speech', this.settings.speech);
833+
this.enableAccessibilityItems('Braille', this.settings.braille);
834+
this.setAccessibilityMenus();
838835
const renderer = this.settings.renderer.replace(/[^a-zA-Z0-9]/g, '') || 'CHTML';
839836
const promise = (Menu._loadingPromise || Promise.resolve()).then(
840837
() => (renderer !== this.defaultSettings.renderer ?
@@ -949,6 +946,8 @@ export class Menu {
949946
const enable = this.settings.enrich;
950947
const method = (enable ? 'enable' : 'disable');
951948
['Speech', 'Braille', 'Explorer'].forEach(id => this.menu.findID(id)[method]());
949+
const options = this.document.options;
950+
options.enableSpeech = options.enableBraille = options.enableExplorer = enable;
952951
if (!enable) {
953952
this.settings.collapsible = false;
954953
this.document.options.enableCollapsible = false;
@@ -1001,7 +1000,7 @@ export class Menu {
10011000
* @param {boolean} enrich True to enable enriched math, false to not
10021001
*/
10031002
protected setEnrichment(enrich: boolean) {
1004-
this.document.options.enableEnrichment = this.document.options.enableExplorer = enrich;
1003+
this.document.options.enableEnrichment = enrich;
10051004
this.setAccessibilityMenus();
10061005
if (!enrich || MathJax._?.a11y?.['semantic-enrich']) {
10071006
this.rerender(STATE.COMPILED);

0 commit comments

Comments
 (0)