diff options
Diffstat (limited to 'node_modules/jquery/src/traversing/var/dir.js')
-rw-r--r-- | node_modules/jquery/src/traversing/var/dir.js | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/node_modules/jquery/src/traversing/var/dir.js b/node_modules/jquery/src/traversing/var/dir.js new file mode 100644 index 0000000000..b98fdca0e9 --- /dev/null +++ b/node_modules/jquery/src/traversing/var/dir.js @@ -0,0 +1,20 @@ +define( [ + "../../core" +], function( jQuery ) { + +return function( elem, dir, until ) { + var matched = [], + truncate = until !== undefined; + + while ( ( elem = elem[ dir ] ) && elem.nodeType !== 9 ) { + if ( elem.nodeType === 1 ) { + if ( truncate && jQuery( elem ).is( until ) ) { + break; + } + matched.push( elem ); + } + } + return matched; +}; + +} ); |