mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-12-03 02:16:51 +00:00
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:
parent
610f41e06a
commit
9455e1f3ab
|
@ -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' );
|
||||||
|
|
Loading…
Reference in a new issue