Bug Tracker

Changes between Initial Version and Version 2 of Ticket #4446


Ignore:
Timestamp:
May 3, 2009, 4:42:10 PM (11 years ago)
Author:
brandon
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #4446 – Description

    initial v2  
    11Why not andSelf() function to have a selector param. Here is a particular example
    2 
     2{{{
    33$('element').nextAll('.className').andSelf('.className').doSomething();
    4 
     4}}}
    55This way one can add self only if it meets particular requirements.
    66
    77Here is a fast solution :)
    88
     9{{{
    910$.fn.andSelf = function(selector){ return (selector == null || this.prevObject.is(selector)) ? this.add( this.prevObject ) : this; }
     11}}}