Load menu and zoom code after typesetting is complete (if not already loaded) so they will be available when needed.

This commit is contained in:
Davide P. Cervone 2012-01-23 12:06:50 -05:00
parent 6456a50e52
commit 45c91aa905
2 changed files with 23 additions and 1 deletions

File diff suppressed because one or more lines are too long

View File

@ -1912,6 +1912,27 @@ MathJax.Hub.Startup = {
{setTimeout("document.location = document.location.hash",1)}
},
//
// Load the Menu and Zoom code, if it hasn't already been loaded.
// This is called after the initial typeset, so should no longer be
// competing with other page loads, but will make these available
// if needed later on.
//
MenuZoom: function () {
if (!MathJax.Extension.MathMenu) {
setTimeout(
MathJax.Callback(["Require",MathJax.Ajax,"[MathJax]/extensions/MathMenu.js"]),
1000
);
}
if (!MathJax.Extension.MathZoom) {
setTimeout(MathJax.Callback(
["Require",MathJax.Ajax,"[MathJax]/extensions/MathZoom.js"]),
2000
);
}
},
//
// Setup the onload callback
//
@ -2389,6 +2410,7 @@ MathJax.Hub.Startup = {
function () {MathJax.isReady = true}, // indicates that MathJax is ready to process math
["Typeset",STARTUP],
["Hash",STARTUP],
["MenuZoom",STARTUP],
["Post",STARTUP.signal,"End"]
);