LivePreview: Use setTimeout to delay rendering of MathJax
wikipage.content hook is fired before the new content is attached, but MathJax cannot deal with that. Use setTimeout to delay execution until next execution run. Bug: T90808 Change-Id: I02178bfd61d34dff49435f3a17a0ce385b37d14d
This commit is contained in:
parent
d4551894a0
commit
fbfefac248
|
@ -225,7 +225,9 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( MathJax.isReady ) {
|
if ( MathJax.isReady ) {
|
||||||
render();
|
// Call render asynchronous because live preview fires the hook with
|
||||||
|
// detached $content. See T90808
|
||||||
|
setTimeout( render );
|
||||||
} else {
|
} else {
|
||||||
mw.loader.using( 'ext.math.mathjax.mathjax', function () {
|
mw.loader.using( 'ext.math.mathjax.mathjax', function () {
|
||||||
MathJax.Hub.Startup.signal.MessageHook( 'End', render );
|
MathJax.Hub.Startup.signal.MessageHook( 'End', render );
|
||||||
|
|
Loading…
Reference in New Issue