Revert "Ajax: remove deprecated extensions from ajax promise"

This reverts commit 9d1b989f20.
This commit is contained in:
Oleg Gaidarenko 2015-11-13 16:17:36 +03:00
parent c69673fe41
commit 8a0176279f
2 changed files with 13 additions and 6 deletions

View File

@ -513,7 +513,9 @@ jQuery.extend( {
}; };
// Attach deferreds // 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) // Remove hash character (#7531: and string promotion)
// Add protocol if not provided (prefilters might expect it) // Add protocol if not provided (prefilters might expect it)
@ -646,9 +648,9 @@ jQuery.extend( {
strAbort = "abort"; strAbort = "abort";
// Install callbacks on deferreds // Install callbacks on deferreds
completeDeferred.add( s.complete ); for ( i in { success: 1, error: 1, complete: 1 } ) {
jqXHR.done( s.success ); jqXHR[ i ]( s[ i ] );
jqXHR.fail( s.error ); }
// Get transport // Get transport
transport = inspectPrefiltersOrTransports( transports, s, options, jqXHR ); transport = inspectPrefiltersOrTransports( transports, s, options, jqXHR );

9
src/effects.js vendored
View File

@ -3,6 +3,7 @@ define( [
"./var/document", "./var/document",
"./var/rcssNum", "./var/rcssNum",
"./css/var/cssExpand", "./css/var/cssExpand",
"./var/rnotwhite",
"./css/var/isHidden", "./css/var/isHidden",
"./css/adjustCSS", "./css/adjustCSS",
"./css/defaultDisplay", "./css/defaultDisplay",
@ -14,7 +15,7 @@ define( [
"./css", "./css",
"./deferred", "./deferred",
"./traversing" "./traversing"
], function( jQuery, document, rcssNum, cssExpand, ], function( jQuery, document, rcssNum, cssExpand, rnotwhite,
isHidden, adjustCSS, defaultDisplay, dataPriv ) { isHidden, adjustCSS, defaultDisplay, dataPriv ) {
var var
@ -331,6 +332,10 @@ function Animation( elem, properties, options ) {
for ( ; index < length ; index++ ) { for ( ; index < length ; index++ ) {
result = Animation.prefilters[ index ].call( animation, elem, props, animation.opts ); result = Animation.prefilters[ index ].call( animation, elem, props, animation.opts );
if ( result ) { if ( result ) {
if ( jQuery.isFunction( result.stop ) ) {
jQuery._queueHooks( animation.elem, animation.opts.queue ).stop =
jQuery.proxy( result.stop, result );
}
return result; return result;
} }
} }
@ -370,7 +375,7 @@ jQuery.Animation = jQuery.extend( Animation, {
callback = props; callback = props;
props = [ "*" ]; props = [ "*" ];
} else { } else {
props = props.split( " " ); props = props.match( rnotwhite );
} }
var prop, var prop,