]> source.dussan.org Git - jquery.git/commitdiff
Adds jQuery collection to objects that will be used as global events context if provi...
authorjaubourg <j@ubourg.net>
Mon, 7 Feb 2011 16:09:47 +0000 (17:09 +0100)
committerjaubourg <j@ubourg.net>
Mon, 7 Feb 2011 16:09:47 +0000 (17:09 +0100)
src/ajax.js

index 2b6b80f9016c8edf70504485f7441a4cdac610cc..76f983499e811e959f260ef479ca3711f66dd928 100644 (file)
@@ -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(),