Opened 15 years ago
Closed 13 years ago
#2851 closed enhancement (fixed)
filter and is should accept complex selectors
Reported by: | scottgonzalez | Owned by: | flesler |
---|---|---|---|
Priority: | major | Milestone: | 1.3 |
Component: | selector | Version: | 1.2.3 |
Keywords: | Cc: | scott.gonzalez, john | |
Blocked by: | Blocking: |
Description
Change History (8)
comment:1 Changed 15 years ago by
Owner: | set to flesler |
---|---|
Status: | new → assigned |
comment:2 Changed 15 years ago by
comment:4 Changed 15 years ago by
Rather than adding complex selectors (which would require more sophisticated string parsing and likely slow down everything), why not be consistent with "not" and allow arrays? Something like:
selector.length && selector[selector.length - 1] !== undefined && !selector.nodeType && return this.filter(function(){
jQuery.inArray( this, selector )
})
Then you could do $('code').filter($('pre > code')) which might be slow itself but would not affect other uses of filter.
comment:5 Changed 15 years ago by
Oops--WikiFormatting killed my code. Supposed to be:
!|| selector.length && selector[selector.length - 1] !== undefined && !selector.nodeType && return this.filter(function(){ jQuery.inArray( this, selector ) })
comment:6 Changed 15 years ago by
OK, I can't get WikiFormatting to listen to me. Ignore the first ! in the code above.
comment:7 Changed 14 years ago by
Cc: | scott.gonzalez john added |
---|---|
Component: | core → selector |
Milestone: | 1.2.4 → 1.3 |
comment:8 Changed 13 years ago by
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
Fixed in 1.3: http://docs.jquery.com/Release:jQuery_1.3#Features
Note: See
TracTickets for help on using
tickets.
Related to #3137