showing who is replying in the active users block

This commit is contained in:
Julian Lam
2014-03-01 15:46:13 -05:00
parent ea222a4295
commit b3d7ae1c86
3 changed files with 53 additions and 2 deletions

View File

@@ -613,7 +613,8 @@ define(['composer', 'forum/pagination'], function(composer, pagination) {
'event:topic_deleted', 'event:topic_restored', 'event:topic:locked',
'event:topic_unlocked', 'event:topic_pinned', 'event:topic_unpinned',
'event:topic_moved', 'event:post_edited', 'event:post_deleted', 'event:post_restored',
'posts.favourite', 'user.isOnline', 'posts.upvote', 'posts.downvote'
'posts.favourite', 'user.isOnline', 'posts.upvote', 'posts.downvote',
'event:topic.replyStart', 'event:topic.replyStop'
]);
socket.on('get_users_in_room', function(data) {
@@ -876,6 +877,14 @@ define(['composer', 'forum/pagination'], function(composer, pagination) {
}
});
socket.on('event:topic.replyStart', function(uid) {
$('.thread_active_users [data-uid="' + uid + '"]').addClass('replying');
});
socket.on('event:topic.replyStop', function(uid) {
$('.thread_active_users [data-uid="' + uid + '"]').removeClass('replying');
});
function adjust_rep(value, pid, uid) {
var votes = $('li[data-pid="' + pid + '"] .votes'),
reputationElements = $('.reputation[data-uid="' + uid + '"]'),