mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-12-01 09:26:37 +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 );
|
||||
|
||||
// Preload image
|
||||
$image
|
||||
.load( ve.bind( this.onThumbnailLoad, this ) )
|
||||
.error( ve.bind( this.onThumbnailError, this ) );
|
||||
$image.on( {
|
||||
'load': ve.bind( this.onThumbnailLoad, this ),
|
||||
'error': ve.bind( this.onThumbnailError, this )
|
||||
} );
|
||||
|
||||
image.src = info.thumburl;
|
||||
|
||||
$thumb.addClass( 've-ui-mwMediaResultWidget-thumbnail' );
|
||||
|
|
Loading…
Reference in a new issue