File tree 2 files changed +22
-3
lines changed
2 files changed +22
-3
lines changed Original file line number Diff line number Diff line change 28
28
*/
29
29
30
30
( function ( HUB , AJAX ) {
31
- var VERSION = "2.3" ;
31
+ var VERSION = "2.3.1 " ;
32
32
33
33
var CONFIG = MathJax . Hub . CombineConfig ( "MatchWebFonts" , {
34
34
matchFor : {
98
98
//
99
99
// Remove markers
100
100
//
101
+ scripts = scripts . concat ( size ) ; // some scripts have been moved to the size array
101
102
for ( i = 0 , m = scripts . length ; i < m ; i ++ ) {
102
103
script = scripts [ i ] ;
103
- if ( script . parentNode && script . MathJax . elementJax ) {
104
+ if ( script && script . parentNode && script . MathJax . elementJax ) {
104
105
script . parentNode . removeChild ( script . previousSibling ) ;
105
106
}
106
107
}
164
165
//
165
166
// Remove markers
166
167
//
168
+ scripts = scripts . concat ( size ) ; // some scripts have been moved to the size array
167
169
for ( i = 0 , m = scripts . length ; i < m ; i ++ ) {
168
170
script = scripts [ i ] ;
169
171
if ( script . parentNode && script . MathJax . elementJax ) {
303
305
} ) ;
304
306
} ) ;
305
307
306
- HUB . Startup . signal . Post ( "MathWebFont Extension Ready" ) ;
308
+ HUB . Startup . signal . Post ( "MatchWebFonts Extension Ready" ) ;
307
309
AJAX . loadComplete ( "[MathJax]/extensions/MatchWebFonts.js" ) ;
308
310
309
311
} ) ( MathJax . Hub , MathJax . Ajax ) ;
Original file line number Diff line number Diff line change 469
469
//
470
470
InitializeHTML : function ( ) {
471
471
this . PreloadWebFonts ( ) ;
472
+ this . getDefaultExEm ( ) ;
473
+ //
474
+ // If the defaultEm size is zero, it might be that a web font hasn't
475
+ // arrived yet, so try to wait for it, but don't wait too long.
476
+ //
477
+ if ( this . defaultEm ) return ;
478
+ var ready = MathJax . Callback ( ) ;
479
+ AJAX . timer . start ( AJAX , function ( check ) {
480
+ if ( check . time ( ready ) ) { HUB . signal . Post ( "HTML-CSS Jax - no default em size" ) ; return }
481
+ HTMLCSS . getDefaultExEm ( ) ;
482
+ if ( HTMLCSS . defaultEm ) { ready ( ) } else { setTimeout ( check , check . delay ) }
483
+ } , this . defaultEmDelay , this . defaultEmTimeout ) ;
484
+ return ready ;
485
+ } ,
486
+ defaultEmDelay : 100 , // initial delay when checking for defaultEm
487
+ defaultEmTimeout : 1000 , // when to stop looking for defaultEm
488
+ getDefaultExEm : function ( ) {
472
489
//
473
490
// Get the default sizes (need styles in place to do this)
474
491
//
You can’t perform that action at this time.
0 commit comments