jquery core: closes #5186. getElementsByTagName optimization was breaking the selector attribute.

This commit is contained in:
Ariel Flesler 2009-09-09 16:33:16 +00:00
parent 9de120e6d7
commit bf230ffb6a

View file

@ -111,6 +111,7 @@ jQuery.fn = jQuery.prototype = {
// HANDLE: $("TAG") // HANDLE: $("TAG")
} else if ( !context && /^\w+$/.test( selector ) ) { } else if ( !context && /^\w+$/.test( selector ) ) {
this.selector = selector;
selector = document.getElementsByTagName( selector ); selector = document.getElementsByTagName( selector );
// HANDLE: $(expr, $(...)) // HANDLE: $(expr, $(...))
@ -129,8 +130,7 @@ jQuery.fn = jQuery.prototype = {
return rootjQuery.ready( selector ); return rootjQuery.ready( selector );
} }
// Make sure that old selector state is passed along if (selector.selector !== undefined) {
if ( selector.selector && selector.context ) {
this.selector = selector.selector; this.selector = selector.selector;
this.context = selector.context; this.context = selector.context;
} }