Chapter 14

This commit is contained in:
2022-01-20 19:15:20 +00:00
parent dfce94d9e3
commit 669a34628f
21 changed files with 1037 additions and 23 deletions

View File

@ -0,0 +1,16 @@
/**
* Simple (ugly) code to handle the comment vote up/down
*/
var $container = $('.js-vote-arrows');
$container.find('a').on('click', function(e) {
e.preventDefault();
var $link = $(e.currentTarget);
$.ajax({
url: '/comments/10/vote/'+$link.data('direction'),
method: 'POST'
}).then(function(response) {
$container.find('.js-vote-total').text(response.votes);
});
});