Fixed comment rating
This commit is contained in:
parent
e71e6a7b32
commit
d8686e5a14
@ -76,11 +76,16 @@ $(document).on('click','body .comment-action-rating',function(e){
|
|||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
|
|
||||||
var $this = $(this);
|
var $this = $(this);
|
||||||
var nodeId = $this.parent().parent().parent().data('node_id');
|
var nodeId = $this.closest('.comment-container').data('node-id');
|
||||||
var is_positive = !$this.hasClass('down');
|
var is_positive = !$this.hasClass('down');
|
||||||
var parentDiv = $this.parent();
|
var parentDiv = $this.parent();
|
||||||
var rated_positive = parentDiv.hasClass('positive');
|
var rated_positive = parentDiv.hasClass('positive');
|
||||||
|
|
||||||
|
if (typeof nodeId === 'undefined') {
|
||||||
|
if (console) console.log('Undefined node ID');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
var op;
|
var op;
|
||||||
if (parentDiv.hasClass('rated') && is_positive == rated_positive) {
|
if (parentDiv.hasClass('rated') && is_positive == rated_positive) {
|
||||||
op = 'revoke';
|
op = 'revoke';
|
||||||
|
Loading…
x
Reference in New Issue
Block a user