mirror of
https://github.com/processwire/processwire.git
synced 2025-08-15 11:14:12 +02:00
Update comments.js to allow for de-selection of stars in cases where a user might accidentally click on a stars input and want to revert to no-selection.
This commit is contained in:
@@ -85,6 +85,8 @@ function CommentFormStars() {
|
|||||||
var value = parseInt(jQuery(this).attr('data-value'));
|
var value = parseInt(jQuery(this).attr('data-value'));
|
||||||
var $parent = jQuery(this).parent();
|
var $parent = jQuery(this).parent();
|
||||||
var $input = $parent.prev('input');
|
var $input = $parent.prev('input');
|
||||||
|
var valuePrev = parseInt($input.val());
|
||||||
|
if(value === valuePrev) value = 0; // click on current value to unset
|
||||||
$input.val(value).attr('value', value); // redundancy intended, val() not working on webkit mobile for some reason
|
$input.val(value).attr('value', value); // redundancy intended, val() not working on webkit mobile for some reason
|
||||||
setStars($parent, value);
|
setStars($parent, value);
|
||||||
$input.change();
|
$input.change();
|
||||||
|
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user