ve.ui.MWMediaResultWidget: Use .on() instead of .error()

> JQMIGRATE: jQuery.fn.error() is deprecated.

While at it, also avoid using the overloaded .load(). It has
quite a few different signatures (one of them is to load $.ajax
by url and replace the contents of the element, completely
unrelated), and calling .on() directly is quicker as well.

Change-Id: I139b0c603577b5a0102d2ff679bd86b792830e3e
This commit is contained in:
Timo Tijhof 2014-05-07 20:21:52 +02:00
parent 610f41e06a
commit 9455e1f3ab

View file

@ -78,9 +78,11 @@ ve.ui.MWMediaResultWidget.prototype.buildThumbnail = function () {
$thumb = $back.add( $front ); $thumb = $back.add( $front );
// Preload image // Preload image
$image $image.on( {
.load( ve.bind( this.onThumbnailLoad, this ) ) 'load': ve.bind( this.onThumbnailLoad, this ),
.error( ve.bind( this.onThumbnailError, this ) ); 'error': ve.bind( this.onThumbnailError, this )
} );
image.src = info.thumburl; image.src = info.thumburl;
$thumb.addClass( 've-ui-mwMediaResultWidget-thumbnail' ); $thumb.addClass( 've-ui-mwMediaResultWidget-thumbnail' );