fix voting on newly-posted comments

Bind click event to comments ol instead of existing elements so new
ajaxed-in comments can be voted on.

Fix #571
This commit is contained in:
Guillermo Bonvehí 2018-10-17 09:59:22 -03:00 committed by Peter Bhat Harkins
parent b4e18e08e6
commit b4d3775288
1 changed files with 3 additions and 2 deletions

View File

@ -385,11 +385,12 @@ var _Lobsters = Class.extend({
var Lobsters = new _Lobsters();
$(document).ready(function() {
$(".comment a.downvoter").click(function() {
var $olcomments = $("ol.comments");
$olcomments.on("click", ".comment a.downvoter", function() {
Lobsters.downvoteComment(this);
return false;
});
$(".comment a.upvoter").click(function() {
$olcomments.on("click", ".comment a.upvoter", function() {
Lobsters.upvoteComment(this);
return false;
});