From 8a0176279f3bc095fb3c57d8b2c58420534857cc Mon Sep 17 00:00:00 2001 From: Oleg Gaidarenko Date: Fri, 13 Nov 2015 16:17:36 +0300 Subject: [PATCH] Revert "Ajax: remove deprecated extensions from ajax promise" This reverts commit 9d1b989f20b550af3590691723b0620f6914626e. --- src/ajax.js | 10 ++++++---- src/effects.js | 9 +++++++-- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/src/ajax.js b/src/ajax.js index 4feed36b5..ba3224832 100644 --- a/src/ajax.js +++ b/src/ajax.js @@ -513,7 +513,9 @@ jQuery.extend( { }; // Attach deferreds - deferred.promise( jqXHR ); + deferred.promise( jqXHR ).complete = completeDeferred.add; + jqXHR.success = jqXHR.done; + jqXHR.error = jqXHR.fail; // Remove hash character (#7531: and string promotion) // Add protocol if not provided (prefilters might expect it) @@ -646,9 +648,9 @@ jQuery.extend( { strAbort = "abort"; // Install callbacks on deferreds - completeDeferred.add( s.complete ); - jqXHR.done( s.success ); - jqXHR.fail( s.error ); + for ( i in { success: 1, error: 1, complete: 1 } ) { + jqXHR[ i ]( s[ i ] ); + } // Get transport transport = inspectPrefiltersOrTransports( transports, s, options, jqXHR ); diff --git a/src/effects.js b/src/effects.js index 8594fd628..ab6fe6d79 100644 --- a/src/effects.js +++ b/src/effects.js @@ -3,6 +3,7 @@ define( [ "./var/document", "./var/rcssNum", "./css/var/cssExpand", + "./var/rnotwhite", "./css/var/isHidden", "./css/adjustCSS", "./css/defaultDisplay", @@ -14,7 +15,7 @@ define( [ "./css", "./deferred", "./traversing" -], function( jQuery, document, rcssNum, cssExpand, +], function( jQuery, document, rcssNum, cssExpand, rnotwhite, isHidden, adjustCSS, defaultDisplay, dataPriv ) { var @@ -331,6 +332,10 @@ function Animation( elem, properties, options ) { for ( ; index < length ; index++ ) { result = Animation.prefilters[ index ].call( animation, elem, props, animation.opts ); if ( result ) { + if ( jQuery.isFunction( result.stop ) ) { + jQuery._queueHooks( animation.elem, animation.opts.queue ).stop = + jQuery.proxy( result.stop, result ); + } return result; } } @@ -370,7 +375,7 @@ jQuery.Animation = jQuery.extend( Animation, { callback = props; props = [ "*" ]; } else { - props = props.split( " " ); + props = props.match( rnotwhite ); } var prop,