-
Notifications
You must be signed in to change notification settings - Fork 61
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix plugin detail rating #359
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## master #359 +/- ##
==========================================
+ Coverage 36.06% 36.08% +0.01%
==========================================
Files 111 111
Lines 4899 4900 +1
==========================================
+ Hits 1767 1768 +1
Misses 3132 3132 ☔ View full report in Codecov by Sentry. |
// The last star will depend on the decimal left | ||
if(starIdx < initialRating) { | ||
star.addClass('jquery-ratings-full'); | ||
let ratingDiff = initialRating - starIdx | ||
if (ratingDiff > 0 && ratingDiff <= 0.3) { | ||
star.addClass('jquery-ratings-quarter'); | ||
} | ||
else if (ratingDiff > 0.3 && ratingDiff <= 0.6) { | ||
star.addClass('jquery-ratings-half'); | ||
} | ||
else if (ratingDiff > 0.6 && ratingDiff <= 0.9) { | ||
star.addClass('jquery-ratings-half-and-quarter'); | ||
} | ||
else { | ||
star.addClass('jquery-ratings-full'); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool, thanks 👍 On a first sight I was wondering about the uneven distribution >0.3 <= 0.6 for the "half star", but how you implemented it, every "partial star" is displayed for a range of 0.3 which is fine. With the stars it's hard to spot how many decimals are represented anyway :-)
Change summary