X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=src%2Fcore.js;h=fe5dbc6bf053b91764b2c5fbcf8a042a590dfb9d;hb=d62875fb0181c44f8b34a8e842ae323801637b25;hp=c4c3867175a7980b9c00033704aec1f9b2f68427;hpb=d8706c5ac95a0e17ac0bb84d5ff3ee7a6eb38161;p=jquery.git diff --git a/src/core.js b/src/core.js index c4c3867..fe5dbc6 100644 --- a/src/core.js +++ b/src/core.js @@ -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)); }, @@ -968,11 +974,15 @@ jQuery.extend({ if( jQuery.nodeName( elem, "form" ) && elem.getAttributeNode(name) ) return elem.getAttributeNode( name ).nodeValue; - // elem.tabindex doesn't always return the correct value + // elem.tabIndex doesn't always return the correct value when it hasn't been explicitly set // http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/ - if ( name == jQuery.props.tabindex ) { - var attributeNode = elem.getAttributeNode(jQuery.props.tabindex); - return attributeNode && attributeNode.specified && attributeNode.value || undefined; + if ( name == "tabIndex" ) { + var attributeNode = elem.getAttributeNode( "tabIndex" ); + return attributeNode && attributeNode.specified + ? attributeNode.value + : elem.nodeName.match(/^(a|area|button|input|object|select|textarea)$/i) + ? 0 + : undefined; } return elem[ name ];