Fixed issue with $( obj, jQuery ) breaking the original jQuery object.

1.7/enhancement_8685
John Resig 2006-08-20 21:58:30 +00:00
parent 367abc373b
commit 8ff329b0f3
1 changed files with 4 additions and 2 deletions

View File

@ -59,10 +59,12 @@ function jQuery(a,c) {
*/
// Watch for when a jQuery object is passed as the selector
if ( a.jquery ) return a;
if ( a.jquery )
return $( jQuery.merge( a, [] ) );
// Watch for when a jQuery object is passed at the context
if ( c && c.jquery ) return c.find(a);
if ( c && c.jquery )
return $( c ).find(a);
// If the context is global, return a new object
if ( window == this )