Merge branch 'issue576' into develop. Issue #576.
This commit is contained in:
commit
d553f18625
|
@ -28,7 +28,7 @@
|
|||
*/
|
||||
|
||||
(function (HUB,AJAX) {
|
||||
var VERSION = "2.3";
|
||||
var VERSION = "2.3.1";
|
||||
|
||||
var CONFIG = MathJax.Hub.CombineConfig("MatchWebFonts",{
|
||||
matchFor: {
|
||||
|
@ -98,9 +98,10 @@
|
|||
//
|
||||
// Remove markers
|
||||
//
|
||||
scripts = scripts.concat(size); // some scripts have been moved to the size array
|
||||
for (i = 0, m = scripts.length; i < m; i++) {
|
||||
script = scripts[i];
|
||||
if (script.parentNode && script.MathJax.elementJax) {
|
||||
if (script && script.parentNode && script.MathJax.elementJax) {
|
||||
script.parentNode.removeChild(script.previousSibling);
|
||||
}
|
||||
}
|
||||
|
@ -164,6 +165,7 @@
|
|||
//
|
||||
// Remove markers
|
||||
//
|
||||
scripts = scripts.concat(size); // some scripts have been moved to the size array
|
||||
for (i = 0, m = scripts.length; i < m; i++) {
|
||||
script = scripts[i];
|
||||
if (script.parentNode && script.MathJax.elementJax) {
|
||||
|
@ -303,7 +305,7 @@
|
|||
});
|
||||
});
|
||||
|
||||
HUB.Startup.signal.Post("MathWebFont Extension Ready");
|
||||
HUB.Startup.signal.Post("MatchWebFonts Extension Ready");
|
||||
AJAX.loadComplete("[MathJax]/extensions/MatchWebFonts.js");
|
||||
|
||||
})(MathJax.Hub,MathJax.Ajax);
|
||||
|
|
|
@ -469,6 +469,23 @@
|
|||
//
|
||||
InitializeHTML: function () {
|
||||
this.PreloadWebFonts();
|
||||
this.getDefaultExEm();
|
||||
//
|
||||
// If the defaultEm size is zero, it might be that a web font hasn't
|
||||
// arrived yet, so try to wait for it, but don't wait too long.
|
||||
//
|
||||
if (this.defaultEm) return;
|
||||
var ready = MathJax.Callback();
|
||||
AJAX.timer.start(AJAX,function (check) {
|
||||
if (check.time(ready)) {HUB.signal.Post("HTML-CSS Jax - no default em size"); return}
|
||||
HTMLCSS.getDefaultExEm();
|
||||
if (HTMLCSS.defaultEm) {ready()} else {setTimeout(check,check.delay)}
|
||||
},this.defaultEmDelay,this.defaultEmTimeout);
|
||||
return ready;
|
||||
},
|
||||
defaultEmDelay: 100, // initial delay when checking for defaultEm
|
||||
defaultEmTimeout: 1000, // when to stop looking for defaultEm
|
||||
getDefaultExEm: function () {
|
||||
//
|
||||
// Get the default sizes (need styles in place to do this)
|
||||
//
|
||||
|
|
Loading…
Reference in New Issue
Block a user