Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions lib/jquery.raty.js
Original file line number Diff line number Diff line change
Expand Up @@ -564,7 +564,7 @@

if (name) {
var icon = this.opt[name];
var star = this.stars[Math.ceil(score) - 1];
var star = this.stars[Math.max( Math.ceil(score) - 1,0)];

this._setIcon(star, icon);
} // Full down: [x.00 .. x.25]
Expand Down Expand Up @@ -599,7 +599,7 @@
// TODO: model spec
_setTitle: function(score, evt) {
if (score) {
var integer = parseInt(Math.ceil(score), 10);
var integer = parseInt(Math.max(Math.ceil(score),0), 10);
var star = this.stars[integer - 1];

star.title = this._getHint(score, evt);
Expand Down