Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions ts/ui/menu/Menu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,8 @@ export class Menu {
*/
protected document: MenuMathDocument;

protected initialized: boolean = false;

/**
* Instances of the various output jax that we can switch to
*/
Expand Down Expand Up @@ -566,6 +568,7 @@ export class Menu {
this.mergeUserSettings();
this.initMenu();
this.applySettings();
this.initialized = true;
}

/**
Expand Down Expand Up @@ -1108,7 +1111,7 @@ export class Menu {
*/
protected setOverflow(overflow: string) {
this.document.outputJax.options.displayOverflow = overflow.toLowerCase();
if (!Menu.loading) {
if (!Menu.loading && this.initialized) {
this.document.rerenderPromise();
}
}
Expand All @@ -1118,7 +1121,7 @@ export class Menu {
*/
protected setInlineBreaks(breaks: boolean) {
this.document.outputJax.options.linebreaks.inline = breaks;
if (!Menu.loading) {
if (!Menu.loading && this.initialized) {
this.document.rerenderPromise();
}
}
Expand All @@ -1128,7 +1131,7 @@ export class Menu {
*/
protected setScale(scale: string) {
this.document.outputJax.options.scale = parseFloat(scale);
if (!Menu.loading) {
if (!Menu.loading && this.initialized) {
this.document.rerenderPromise();
}
}
Expand Down
Loading