Commit bf230ffb authored by Ariel Flesler's avatar Ariel Flesler

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

parent 9de120e6
...@@ -111,6 +111,7 @@ jQuery.fn = jQuery.prototype = { ...@@ -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 = { ...@@ -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;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment