Skip to content

Commit

Permalink
Update jquery.raty.js
Browse files Browse the repository at this point in the history
  • Loading branch information
markvantilburg authored Oct 1, 2021
1 parent fd66c88 commit 642ddf1
Showing 1 changed file with 2 additions and 2 deletions.
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

0 comments on commit 642ddf1

Please sign in to comment.