Closed (fixed)
Project:
Fivestar
Version:
7.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
13 Sep 2012 at 01:02 UTC
Updated:
16 Feb 2014 at 14:10 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
markwittens commentedSame problem here
Comment #2
greg_meszaros commentedHi,
I checked and i found the issue in fivestar.js file under /js folder.
Try to change this bit of code:
rate: function(event) {
var $this = $(this);
var $widget = event.data;
var value = this.hash.replace('#', '');
$('select', $widget).val(value).change();
var $this_star = $this.closest('.star');
$this_star.prevAll('.star').andSelf().addClass('on');
$this_star.nextAll('.star').removeClass('on');
event.preventDefault();
},
to this:
rate: function(event) {
var $this = $(this);
var $widget = event.data;
var value = this.hash.replace('#', '');
$('select', $widget).val(value).change();
// Cancel rating
if (value == '0') {
$this.closest('.cancel').addClass('star');
var $this_star = $this.closest('.star');
$this_star.nextAll('.star').removeClass('on');
$this.closest('.cancel').removeClass('star');
}
else {
var $this_star = $this.closest('.star');
$this_star.prevAll('.star').andSelf().addClass('on');
$this_star.nextAll('.star').removeClass('on');
event.preventDefault();
}
},
Maybe this is not the best solution, it was just my quick one, but it's solving the problem, and maybe it should be commited to next dev??
I have attached my changed fivestar.js file too.(rename .txt to .js!)
Greg
Comment #3
kaptenkolja commentedI have the same problem. Adding this comment to use in creating a patch. Don't know if I'm tagging this correctly though.
Comment #4
kaptenkolja commentedAttaching patch.
Comment #5
emilymoi commentedSame problem and #4 works great. Thanks.
Comment #6
Plazmus commentedI confirm, same issue resolved with #4 patch.
I wonder why it hasn't been committed yet?
Comment #7
jibize commentedPatch still applies cleanly on latest dev, and it does solve the problem with the Cancel button not clearing the stars on a "rated while editing" widget.
Thanks kaptenkolja!
Comment #8
whiteph commented