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:
Thalia 2015-09-29 17:32:44 +01:00
parent d6931f563e
commit 7241d5d3a7

View file

@ -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 */