diff options
author | jeresig <jeresig@gmail.com> | 2009-11-29 16:22:08 -0500 |
---|---|---|
committer | jeresig <jeresig@gmail.com> | 2009-11-29 16:22:08 -0500 |
commit | 2b7c38f80cf171ce830cd198ed2916a2c258a3cb (patch) | |
tree | abcfc1ef9fccdbf0fbe4ef62ccfd7876d682f2b4 /src/traversing.js | |
parent | e00be67f32f0f82421cefd9c7a715360f9db1f8b (diff) | |
parent | 255068da33e3d131b3a641c041fb8cecb1543fa4 (diff) | |
download | jquery-2b7c38f80cf171ce830cd198ed2916a2c258a3cb.tar.gz jquery-2b7c38f80cf171ce830cd198ed2916a2c258a3cb.zip |
Merge branch 'master' of github.com:jquery/jquery
Diffstat (limited to 'src/traversing.js')
-rw-r--r-- | src/traversing.js | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/traversing.js b/src/traversing.js index 85976a3c0..b5a5a2dee 100644 --- a/src/traversing.js +++ b/src/traversing.js @@ -6,18 +6,21 @@ var winnow = function( elements, qualifier, keep ) { } else if( qualifier.nodeType ) { return jQuery.grep(elements, function(elem, i) { return (elem === qualifier) === keep; - }) + }); } else if( typeof qualifier === "string" ) { - var filtered = jQuery.grep(elements, function(elem) { return elem.nodeType === 1 }); + var filtered = jQuery.grep(elements, function(elem) { return elem.nodeType === 1; }); - if(isSimple.test( qualifier )) return jQuery.filter(qualifier, filtered, !keep); - else qualifier = jQuery.filter( qualifier, elements ); + if(isSimple.test( qualifier )) { + return jQuery.filter(qualifier, filtered, !keep); + } else { + qualifier = jQuery.filter( qualifier, elements ); + } } return jQuery.grep(elements, function(elem, i) { return (jQuery.inArray( elem, qualifier ) >= 0) === keep; }); -} +}; jQuery.fn.extend({ find: function( selector ) { |