Skip to content

Commit cf00c72

Browse files
committed
Include the menu loading promises in the default startup page ready promise chain so that typesetting doesn't occur until everything is loaded. (mathjax/MathJax#3401)
1 parent 3167719 commit cf00c72

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

ts/components/startup.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ export interface MathJaxConfig extends MJConfig {
7171
/**
7272
* Generic types for the standard MathJax objects
7373
*/
74-
export type MATHDOCUMENT = MathDocument<any, any, any>;
74+
export type MATHDOCUMENT = MathDocument<any, any, any> & {menu?: {loadingPromise: Promise<void>}};
7575
export type HANDLER = Handler<any, any, any>;
7676
export type DOMADAPTOR = DOMAdaptor<any, any, any>;
7777
export type INPUTJAX = InputJax<any, any, any>;
@@ -325,6 +325,7 @@ export abstract class Startup {
325325
? (Startup.output as COMMONJAX).font.loadDynamicFiles()
326326
: Promise.resolve()
327327
)
328+
.then(() => Startup.document.menu?.loadingPromise)
328329
.then(
329330
CONFIG.typeset && MathJax.typesetPromise
330331
? () => Startup.typesetPromise(CONFIG.elements)

0 commit comments

Comments
 (0)