mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-14 17:56:16 +01:00
fixed active users icon in thread
This commit is contained in:
@@ -632,23 +632,22 @@ define(['composer', 'forum/pagination'], function(composer, pagination) {
|
|||||||
'event:topic.replyStart', 'event:topic.replyStop'
|
'event:topic.replyStart', 'event:topic.replyStop'
|
||||||
]);
|
]);
|
||||||
|
|
||||||
socket.on('get_users_in_room', function(data) {
|
function createUserIcon(uid, picture, userslug, username) {
|
||||||
|
if(!$('.thread_active_users').find('[data-uid="' + uid + '"]').length) {
|
||||||
|
var div = $('<div class="inline-block"><a data-uid="' + uid + '" href="' + RELATIVE_PATH + '/user/' + userslug + '"><img src="'+ picture +'"/></a></div>');
|
||||||
|
div.find('a').tooltip({
|
||||||
|
placement: 'top',
|
||||||
|
title: username
|
||||||
|
});
|
||||||
|
|
||||||
|
return div;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
socket.on('get_users_in_room', function(data) {
|
||||||
if(data && data.room.indexOf('topic') !== -1) {
|
if(data && data.room.indexOf('topic') !== -1) {
|
||||||
var activeEl = $('.thread_active_users');
|
var activeEl = $('.thread_active_users');
|
||||||
|
|
||||||
function createUserIcon(uid, picture, userslug, username) {
|
|
||||||
if(!activeEl.find('[data-uid="' + uid + '"]').length) {
|
|
||||||
var div = $('<div class="inline-block"><a data-uid="' + uid + '" href="' + RELATIVE_PATH + '/user/' + userslug + '"><img src="'+ picture +'"/></a></div>');
|
|
||||||
div.find('a').tooltip({
|
|
||||||
placement: 'top',
|
|
||||||
title: username
|
|
||||||
});
|
|
||||||
|
|
||||||
return div;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// remove users that are no longer here
|
// remove users that are no longer here
|
||||||
activeEl.find('a').each(function(index, element) {
|
activeEl.find('a').each(function(index, element) {
|
||||||
if(element) {
|
if(element) {
|
||||||
|
|||||||
Reference in New Issue
Block a user