mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Math
synced 2024-11-24 07:34:22 +00:00
Check for error in Parsoid response for math node
An error will contain an element with class "error". Relies on I3f4ba354a in visual editor core in order to work. Also remove old afterRender method. Bug: T112610 Change-Id: Ie681806aebfdd7de918685c9343f5e176baaf517
This commit is contained in:
parent
d6931f563e
commit
7241d5d3a7
|
@ -46,22 +46,10 @@ ve.ce.MWMathNode.prototype.onSetup = function () {
|
|||
};
|
||||
|
||||
/**
|
||||
* @inheritdoc
|
||||
* @inheritdoc ve.ce.GeneratedContentNode
|
||||
*/
|
||||
ve.ce.MWMathNode.prototype.afterRender = function () {
|
||||
var $img,
|
||||
node = this;
|
||||
|
||||
$img = this.$element.filter( 'img.tex' );
|
||||
// Rerender after image load
|
||||
if ( $img.length ) {
|
||||
$img.on( 'load', function () {
|
||||
node.emit( 'rerender' );
|
||||
} );
|
||||
} else {
|
||||
// Passing an empty string, or using MathML, returns no image, so rerender immediately
|
||||
this.emit( 'rerender' );
|
||||
}
|
||||
ve.ce.MWMathNode.prototype.validateGeneratedContents = function ( $element ) {
|
||||
return !( $element.find( '.error' ).length );
|
||||
};
|
||||
|
||||
/* Registration */
|
||||
|
|
Loading…
Reference in a new issue