When there are no ratings no stars should be highlighted - when using jQuery 1.8+ 4 of the stars are highlighted.

Comments

__cj’s picture

Status: Reviewed & tested by the community » Active
StatusFileSize
new515 bytes

This is because of a slight change in the way jQuery handles negative numbers in the :lt() selector - prior to 1.8 negative number select nothing, but 1.8+ items are unselected from the end of the array (consistent with the behaviour of slice).

I've created a JS fiddle at demonstrate this:
jQuery 1.6 - http://jsfiddle.net/Z5QYz/
jQuery 1.8 - http://jsfiddle.net/Z5QYz/1/
You'll see in the 1.6 version none of the divs are selected, while in the 1.8 version the last one is.

The attached patch fixes this (and still works with previous versions of jQuery), and removes lt selector in favour of slice - this is better for performance (see 'Additional Notes' at http://api.jquery.com/lt-selector/).

EDIT: I also posted a bug for jQuery Docs, which have now been updated with a 'Prior to jQuery 1.8' note explaining the above.

__cj’s picture

Status: Active » Needs review
ryck’s picture

Status: Needs review » Reviewed & tested by the community

Just bumped in to this bug and fixed it the same way.

Status: Active » Reviewed & tested by the community
__cj’s picture

Issue #2130495: The default value is wrong with jQuery 1.8 was opened as a duplicate of this.

whiteph’s picture

Assigned: Unassigned » whiteph
Issue summary: View changes
Status: Reviewed & tested by the community » Fixed

Merged up, and available to download in 7.x-2.x-dev

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.