Landing Ben Alman's patch to add nextUntil, prevUntil, and parentsUntil. Also adds some tests for prevAll and nextAll, and fixes an test edge case in parents.
This commit is contained in:
parent
bbd933cbfe
commit
2b481b93cf
3 changed files with 98 additions and 11 deletions
|
@ -484,13 +484,14 @@ jQuery.extend({
|
|||
return ret;
|
||||
},
|
||||
|
||||
map: function( elems, callback ) {
|
||||
// arg is for internal usage only
|
||||
map: function( elems, callback, arg ) {
|
||||
var ret = [], value;
|
||||
|
||||
// Go through the array, translating each of the items to their
|
||||
// new value (or values).
|
||||
for ( var i = 0, length = elems.length; i < length; i++ ) {
|
||||
value = callback( elems[ i ], i );
|
||||
value = callback( elems[ i ], i, arg );
|
||||
|
||||
if ( value != null ) {
|
||||
ret[ ret.length ] = value;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue