Bug Tracker

Opened 12 years ago

Closed 12 years ago

#7894 closed bug (wontfix)

Selector option:gt(-1) doesn't work

Reported by: g_gus Owned by:
Priority: undecided Milestone: 1.6
Component: unfiled Version: 1.4.4
Keywords: Cc:
Blocked by: Blocking:


very similar to #5550 but with a use case that's imho not invalid:

In writing a pagination function it would be useful to have the :gt behave consistently, accepting -1 as a possible value.

Here's a simple use case: http://jsfiddle.net/GMJZ5/1/


Change History (2)

comment:1 Changed 12 years ago by danheberden

Better yet, you could get rid of the custom selectors completely. http://jsfiddle.net/danheberden/yxQgd/

Thanks for taking the time to write out a bug report / feature request. In the case of :gt, gt(-1) seems odd to me. gt(-1) is simply less than something else. That is, :gt(-1):lt(5) is simply lt(5). Plus, there is no -1 index to be greater than. I know if makes sense that index 0 is greater than any negative number, but -1 doesn't exist.

Custom selectors aren't great in any respect, as the above example I pasted doesn't even have to use sizzle. Faster and cleaner; the gains are two fold.

Last edited 12 years ago by danheberden (previous) (diff)

comment:2 Changed 12 years ago by danheberden

Resolution: wontfix
Status: newclosed
Note: See TracTickets for help on using tickets.