Start processing on DOMContentLoaded, if possible, and check document.readyState to see if the onload handler has already fired (avoids the need for authors to call MathJax.Hub.Startup.onload() by hand)
This commit is contained in:
parent
3717fcfb57
commit
53fc357cfc
File diff suppressed because one or more lines are too long
|
@ -1809,7 +1809,12 @@ MathJax.Hub.Startup = {
|
|||
onLoad: function (when) {
|
||||
var onload = this.onload =
|
||||
MathJax.Callback(function () {MathJax.Hub.Startup.signal.Post("onLoad")});
|
||||
if (window.addEventListener) {window.addEventListener("load",onload,false)}
|
||||
if (document.readyState && document.readyState !== "loading") {return [onload]}
|
||||
if (window.addEventListener) {
|
||||
window.addEventListener("load",onload,false);
|
||||
if (!this.params.noDOMContentEvent)
|
||||
{window.addEventListener("DOMContentLoaded",onload,false)}
|
||||
}
|
||||
else if (window.attachEvent) {window.attachEvent("onload",onload)}
|
||||
else {window.onload = onload}
|
||||
return onload;
|
||||
|
|
Loading…
Reference in New Issue
Block a user