From: Timo Tijhof Date: Tue, 22 Nov 2016 02:16:43 +0000 (-0800) Subject: Replace deprecated jQuery bind() with on() X-Git-Tag: 1.31.0-rc.0~4797^2~1 X-Git-Url: http://git.cyclocoop.org/%7B%24admin_url%7Dmembres/cotisations/gestion/rappel_supprimer.php?a=commitdiff_plain;h=a4d39fee7987abbe1b605b79997919882c9131b0;p=lhc%2Fweb%2Fwiklou.git Replace deprecated jQuery bind() with on() > JQMIGRATE: jQuery.fn.bind() is deprecated Note that bind() is not removed in v3, merely deprecated. Even after the jQuery Migrate phase, it will continue to work. https://jquery.com/upgrade-guide/3.0/ Bug: T124742 Change-Id: I6bbd8f829ecf987228c6a5abd32c84e4e088a9bd --- diff --git a/resources/src/jquery/jquery.placeholder.js b/resources/src/jquery/jquery.placeholder.js index ae9c943869..12b0404b27 100644 --- a/resources/src/jquery/jquery.placeholder.js +++ b/resources/src/jquery/jquery.placeholder.js @@ -85,7 +85,7 @@ 'placeholder-password': $input, 'placeholder-id': id } ) - .bind( 'focus.placeholder drop.placeholder', clearPlaceholder ); + .on( 'focus.placeholder drop.placeholder', clearPlaceholder ); $input .data( { 'placeholder-textinput': $replacement, @@ -145,7 +145,7 @@ .filter( function () { return !$( this ).data( 'placeholder-enabled' ); } ) - .bind( { + .on( { 'focus.placeholder drop.placeholder': clearPlaceholder, 'blur.placeholder': setPlaceholder } ) @@ -219,7 +219,7 @@ } ); // Clear placeholder values upon page reload - $( window ).bind( 'beforeunload.placeholder', function () { + $( window ).on( 'beforeunload.placeholder', function () { $( '.placeholder' ).each( function () { this.value = ''; } ); diff --git a/resources/src/mediawiki/mediawiki.searchSuggest.js b/resources/src/mediawiki/mediawiki.searchSuggest.js index cbbd254cf9..fa1a78c5cb 100644 --- a/resources/src/mediawiki/mediawiki.searchSuggest.js +++ b/resources/src/mediawiki/mediawiki.searchSuggest.js @@ -257,7 +257,7 @@ cache: true, highlightInput: true } ) - .bind( 'paste cut drop', function () { + .on( 'paste cut drop', function () { // make sure paste and cut events from the mouse and drag&drop events // trigger the keypress handler and cause the suggestions to update $( this ).trigger( 'keypress' );