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:
Derk-Jan Hartman 2015-02-26 22:55:51 +01:00
parent d4551894a0
commit fbfefac248
1 changed files with 3 additions and 1 deletions

View File

@ -225,7 +225,9 @@
}
if ( MathJax.isReady ) {
render();
// Call render asynchronous because live preview fires the hook with
// detached $content. See T90808
setTimeout( render );
} else {
mw.loader.using( 'ext.math.mathjax.mathjax', function () {
MathJax.Hub.Startup.signal.MessageHook( 'End', render );