Emit rerender on math node if Tex image is not present
This happens with then empty tag is rendered. Bug: 63093 Change-Id: I5cf731cedda134d2542946da82997bddf58b00b5
This commit is contained in:
parent
a8625fd0ed
commit
31df8ff3a8
|
@ -48,7 +48,9 @@ ve.ce.MWMathNode.prototype.onParseSuccess = function ( deferred, response ) {
|
||||||
};
|
};
|
||||||
|
|
||||||
/** */
|
/** */
|
||||||
ve.ce.MWExtensionNode.prototype.afterRender = function ( domElements ) {
|
ve.ce.MWMathNode.prototype.afterRender = function ( domElements ) {
|
||||||
|
var $img;
|
||||||
|
|
||||||
if ( this.$( domElements ).is( 'span.tex' ) ) {
|
if ( this.$( domElements ).is( 'span.tex' ) ) {
|
||||||
// MathJax
|
// MathJax
|
||||||
MathJax.Hub.Queue(
|
MathJax.Hub.Queue(
|
||||||
|
@ -56,10 +58,16 @@ ve.ce.MWExtensionNode.prototype.afterRender = function ( domElements ) {
|
||||||
[ this, this.emit, 'rerender' ]
|
[ this, this.emit, 'rerender' ]
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
|
$img = this.$element.find( 'img.tex' );
|
||||||
// Rerender after image load
|
// Rerender after image load
|
||||||
this.$element.find( 'img.tex' ).on( 'load', ve.bind( function () {
|
if ( $img.length ) {
|
||||||
|
$img.on( 'load', ve.bind( function () {
|
||||||
|
this.emit( 'rerender' );
|
||||||
|
}, this ) );
|
||||||
|
} else {
|
||||||
|
// Passing an empty string returns no image, so rerender immediately
|
||||||
this.emit( 'rerender' );
|
this.emit( 'rerender' );
|
||||||
}, this ) );
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue