aboutsummaryrefslogtreecommitdiffstats
path: root/src/ajax.js
diff options
context:
space:
mode:
authorjaubourg <j@ubourg.net>2011-02-07 17:09:47 +0100
committerjaubourg <j@ubourg.net>2011-02-07 17:09:47 +0100
commit5b421fed003e6704bd0fbba2dea5c1b6add2cf52 (patch)
treeb08c2f08e05009919aa687a45b449cd506438846 /src/ajax.js
parenta2dbdc1f5438a857c2a9898bd36e4b2de685742e (diff)
downloadjquery-5b421fed003e6704bd0fbba2dea5c1b6add2cf52.tar.gz
jquery-5b421fed003e6704bd0fbba2dea5c1b6add2cf52.zip
Adds jQuery collection to objects that will be used as global events context if provided in the ajax options.
Diffstat (limited to 'src/ajax.js')
-rw-r--r--src/ajax.js7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/ajax.js b/src/ajax.js
index 2b6b80f90..76f983499 100644
--- a/src/ajax.js
+++ b/src/ajax.js
@@ -365,9 +365,10 @@ jQuery.extend({
( s.context = ( "context" in options ? options : jQuery.ajaxSettings ).context ) || s,
// Context for global events
// It's the callbackContext if one was provided in the options
- // and if it's a DOM node
- globalEventContext = callbackContext !== s && callbackContext.nodeType ?
- jQuery( callbackContext ) : jQuery.event,
+ // and if it's a DOM node or a jQuery collection
+ globalEventContext = callbackContext !== s &&
+ ( callbackContext.nodeType || callbackContext instanceof jQuery ) ?
+ jQuery( callbackContext ) : jQuery.event,
// Deferreds
deferred = jQuery.Deferred(),
completeDeferred = jQuery._Deferred(),