Changes between Initial Version and Version 2 of Ticket #4446
- Timestamp:
- May 3, 2009, 4:42:10 PM (14 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #4446 – Description
initial v2 1 1 Why not andSelf() function to have a selector param. Here is a particular example 2 2 {{{ 3 3 $('element').nextAll('.className').andSelf('.className').doSomething(); 4 4 }}} 5 5 This way one can add self only if it meets particular requirements. 6 6 7 7 Here is a fast solution :) 8 8 9 {{{ 9 10 $.fn.andSelf = function(selector){ return (selector == null || this.prevObject.is(selector)) ? this.add( this.prevObject ) : this; } 11 }}}