mirror of
https://github.com/jquery/jquery.git
synced 2024-11-23 02:54:22 +00:00
Reformats logic for early abort in beforeSend to limit block imbrication.
This commit is contained in:
parent
03bad0a960
commit
8f8961de90
@ -667,11 +667,10 @@ jQuery.extend({
|
|||||||
// Allow custom headers/mimetypes and early abort
|
// Allow custom headers/mimetypes and early abort
|
||||||
if ( s.beforeSend && ( s.beforeSend.call( callbackContext, jqXHR, s ) === false || state === 2 ) ) {
|
if ( s.beforeSend && ( s.beforeSend.call( callbackContext, jqXHR, s ) === false || state === 2 ) ) {
|
||||||
// Abort if not done already
|
// Abort if not done already
|
||||||
done( 0, "abort" );
|
jqXHR.abort();
|
||||||
// Return false
|
return false;
|
||||||
jqXHR = false;
|
|
||||||
|
|
||||||
} else {
|
}
|
||||||
|
|
||||||
// Install callbacks on deferreds
|
// Install callbacks on deferreds
|
||||||
for ( i in { success: 1, error: 1, complete: 1 } ) {
|
for ( i in { success: 1, error: 1, complete: 1 } ) {
|
||||||
@ -710,7 +709,7 @@ jQuery.extend({
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
return jqXHR;
|
return jqXHR;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user