Selector state wasn't being passed along on a cloned jQuery object.

This commit is contained in:
John Resig 2009-01-08 21:41:58 +00:00
parent 49d0d5b7a3
commit c6f189ac73
2 changed files with 12 additions and 1 deletions

View file

@ -73,6 +73,12 @@ jQuery.fn = jQuery.prototype = {
} else if ( jQuery.isFunction( selector ) )
return jQuery( document ).ready( selector );
// Make sure that old selector state is passed along
if ( selector.selector && selector.context ) {
this.selector = selector.selector;
this.context = selector.context;
}
return this.setArray(jQuery.makeArray(selector));
},