star-rating-svg
star-rating-svg copied to clipboard
If you vote a high value and then vote a low value, the stars do not change to low value
(The first thing I want to congratulate you on your work) Example: disableAfterRate: false and then vote 4 (for example) and after it you vote 2 (for example), stars color don't change and it fixes on 4, not 2. You can check it in 'disableAfeterRate' example y your demo web: http://nashio.github.io/star-rating-svg/demo/
Hey @neoburgos have got any ideas on a workaround for this issue?
I'm experiencing the same... I thought i could apply a clean onHover, but there is no clean() function to reset a given rate.
jquery.star-rating-svg... not the min version... around line 195... changed....
if (stateClass === 'rated' && endIndex > -1) {
// limit to painting only to rated stars, and specific case for half star
if (index <= Math.ceil(endIndex) || (index < 1 && endIndex < 0)) {
$polygonLeft.attr('style', 'fill:'+ratedColor);
}
if (index <= endIndex) {
$polygonRight.attr('style', 'fill:'+ratedColor);
}
}
to...
if (stateClass === 'rated' && endIndex > -1) {
// limit to painting only to rated stars, and specific case for half star
if (index <= Math.ceil(endIndex) || (index < 1 && endIndex < 0)) {
$polygonLeft.attr('style', 'fill:'+ratedColor);
}
if (index <= endIndex) {
$polygonRight.attr('style', 'fill:'+ratedColor);
}
} else {
$polygonLeft.attr('style', 'stroke-opacity: 0');
$polygonRight.attr('style', 'stroke-opacity: 0');
}
Hope it helps.
jquery.star-rating-svg... not the min version... around line 195... changed....
if (stateClass === 'rated' && endIndex > -1) { // limit to painting only to rated stars, and specific case for half star if (index <= Math.ceil(endIndex) || (index < 1 && endIndex < 0)) { $polygonLeft.attr('style', 'fill:'+ratedColor); } if (index <= endIndex) { $polygonRight.attr('style', 'fill:'+ratedColor); } }
to...
if (stateClass === 'rated' && endIndex > -1) { // limit to painting only to rated stars, and specific case for half star if (index <= Math.ceil(endIndex) || (index < 1 && endIndex < 0)) { $polygonLeft.attr('style', 'fill:'+ratedColor); } if (index <= endIndex) { $polygonRight.attr('style', 'fill:'+ratedColor); } } else { $polygonLeft.attr('style', 'stroke-opacity: 0'); $polygonRight.attr('style', 'stroke-opacity: 0'); }
Hope it helps.
It works great, thanks!
Great job. thanks!
disableAfterRate is on init true - set it to false an it will work - just for the guys who check this error and the code doesnt work