Skip to main content

Bug Tracker

Side navigation

#2851 closed enhancement (fixed)

Opened May 13, 2008 01:04PM UTC

Closed July 26, 2010 12:24AM UTC

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
Attachments (0)
Change History (8)

Changed May 13, 2008 04:02PM UTC by flesler comment:1

owner: → flesler
status: newassigned

Changed July 29, 2008 05:19PM UTC by joern comment:2

Related to #3137

Changed July 29, 2008 05:31PM UTC by joern comment:3

Related/duplicate to/of #2266.

Changed August 24, 2008 11:52PM UTC by d.wachss comment:4

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.

Changed August 24, 2008 11:56PM UTC by d.wachss comment:5

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 ) 
      })

Changed August 24, 2008 11:57PM UTC by d.wachss comment:6

OK, I can't get WikiFormatting to listen to me. Ignore the first ! in the code above.

Changed December 25, 2008 08:31PM UTC by flesler comment:7

cc: → scott.gonzalez, john
component: coreselector
milestone: 1.2.41.3

Changed July 26, 2010 12:24AM UTC by dmethvin comment:8

resolution: → fixed
status: assignedclosed