jquery-genealogy icon indicating copy to clipboard operation
jquery-genealogy copied to clipboard

Add $.fn.closestChildren to keep things DRY

Open mathiasbynens opened this issue 13 years ago • 0 comments

Since this pattern is used in both prevCousins and prevNieces, it might be worthwhile to give it its own method. Something like:

$.fn.closestChildren = function() {
    return this.map( function () {
        return $( this ).children().get().reverse();
    } );
};

mathiasbynens avatar Jun 29 '11 07:06 mathiasbynens