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();
|
||||
|
||||
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 parentDiv = $this.parent();
|
||||
var rated_positive = parentDiv.hasClass('positive');
|
||||
|
||||
if (typeof nodeId === 'undefined') {
|
||||
if (console) console.log('Undefined node ID');
|
||||
return;
|
||||
}
|
||||
|
||||
var op;
|
||||
if (parentDiv.hasClass('rated') && is_positive == rated_positive) {
|
||||
op = 'revoke';
|
||||
|
Loading…
x
Reference in New Issue
Block a user