From 9455e1f3ab44238979840f7237e5e53c3a88c912 Mon Sep 17 00:00:00 2001 From: Timo Tijhof Date: Wed, 7 May 2014 20:21:52 +0200 Subject: [PATCH] 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 --- modules/ve-mw/ui/widgets/ve.ui.MWMediaResultWidget.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/modules/ve-mw/ui/widgets/ve.ui.MWMediaResultWidget.js b/modules/ve-mw/ui/widgets/ve.ui.MWMediaResultWidget.js index 9164778037..f907abf605 100755 --- a/modules/ve-mw/ui/widgets/ve.ui.MWMediaResultWidget.js +++ b/modules/ve-mw/ui/widgets/ve.ui.MWMediaResultWidget.js @@ -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' );