Skip to content

Commit

Permalink
The child selector-prefix branch doesn't work with selectors that hav…
Browse files Browse the repository at this point in the history
…e a larger depth. Removing for now - will need to re-evaluate in the future.
  • Loading branch information
jeresig committed Oct 12, 2010
1 parent 5200194 commit 085de84
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
5 changes: 0 additions & 5 deletions src/traversing.js
Expand Up @@ -11,11 +11,6 @@ var runtil = /Until$/,

jQuery.fn.extend({
find: function( selector ) {
// Handle "> div" child selectors and pass them to .children()
if ( typeof selector === "string" && rchild.test( selector ) ) {
return this.children( selector.replace( rchild, "$1" ) );
}

var ret = this.pushStack( "", "find", selector ), length = 0;

for ( var i = 0, l = this.length; i < l; i++ ) {
Expand Down
3 changes: 2 additions & 1 deletion test/unit/traversing.js
@@ -1,7 +1,7 @@
module("traversing");

test("find(String)", function() {
expect(4);
expect(5);
equals( 'Yahoo', jQuery('#foo').find('.blogTest').text(), 'Check for find' );

// using contents will get comments regular, text, and comment nodes
Expand All @@ -10,6 +10,7 @@ test("find(String)", function() {

same( jQuery("#main").find("> div").get(), q("foo", "moretests", "tabindex-tests", "liveHandlerOrder", "siblingTest"), "find child elements" );
same( jQuery("#main").find("> #foo, > #moretests").get(), q("foo", "moretests"), "find child elements" );
same( jQuery("#main").find("> #foo > p").get(), q("sndp", "en", "sap"), "find child elements" );
});

test("is(String)", function() {
Expand Down

0 comments on commit 085de84

Please sign in to comment.