Fix rerendering in VE

this.$element is no longer a wrapper, so use .filter instead
of .find. Don't use domElements argument as this has already
been written to this.$element at this stage (will remove this
argument in VE core).

Change-Id: If24580102201e2b83b57c63d85335bd728a28784
This commit is contained in:
Ed Sanders 2014-07-10 22:42:28 +01:00 committed by Krinkle
parent d8537132e0
commit 47a6bd2073

View File

@ -29,7 +29,6 @@ ve.ce.MWMathNode = function VeCeMWMathNode( model, config ) {
OO.inheritClass( ve.ce.MWMathNode, ve.ce.MWInlineExtensionNode );
/* Static Properties */
ve.ce.MWMathNode.static.name = 'mwMath';
@ -48,17 +47,17 @@ ve.ce.MWMathNode.prototype.onParseSuccess = function ( deferred, response ) {
};
/** */
ve.ce.MWMathNode.prototype.afterRender = function ( domElements ) {
ve.ce.MWMathNode.prototype.afterRender = function () {
var $img;
if ( this.$( domElements ).is( 'span.tex' ) ) {
if ( this.$element.is( 'span.tex' ) ) {
// MathJax
MathJax.Hub.Queue(
[ 'Typeset', MathJax.Hub, this.$element[0] ],
[ this, this.emit, 'rerender' ]
);
} else {
$img = this.$element.find( 'img.tex' );
$img = this.$element.filter( 'img.tex' );
// Rerender after image load
if ( $img.length ) {
$img.on( 'load', ve.bind( function () {