Skip to main content

Bug Tracker

Side navigation

#7894 closed bug (wontfix)

Opened January 04, 2011 02:38PM UTC

Closed January 04, 2011 03:57PM UTC

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:
Description

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/

Thanks.

Attachments (0)
Change History (2)

Changed January 04, 2011 03:39PM UTC by danheberden comment:1

_comment0: Better yet, you could get rid of the custom selectors completely. http://jsfiddle.net/danheberden/yxQgd/1294156233981330
_comment1: 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 anything, 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. \ \ 1294156287492186

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.

Changed January 04, 2011 03:57PM UTC by danheberden comment:2

resolution: → wontfix
status: newclosed