git.asbjorn.biz
/
jquery.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Moved add() tests from core to traversing.
[jquery.git]
/
src
/
traversing.js
diff --git
a/src/traversing.js
b/src/traversing.js
index
d0dd52d
..
bf17b8a
100644
(file)
--- a/
src/traversing.js
+++ b/
src/traversing.js
@@
-235,7
+235,7
@@
jQuery.extend({
dir: function( elem, dir, until ) {
var matched = [], cur = elem[dir];
dir: function( elem, dir, until ) {
var matched = [], cur = elem[dir];
- while ( cur && cur.nodeType !== 9 && (until === undefined || !jQuery( cur ).is( until )) ) {
+ while ( cur && cur.nodeType !== 9 && (until === undefined || cur.nodeType !== 1 || !jQuery( cur ).is( until )) ) {
if ( cur.nodeType === 1 ) {
matched.push( cur );
}
if ( cur.nodeType === 1 ) {
matched.push( cur );
}