get correct count only from one of the active users elements

This commit is contained in:
barisusakli
2014-10-17 01:11:55 -04:00
parent fec84821b7
commit 3ba4d2aa2b

View File

@@ -23,7 +23,7 @@ define('forum/topic/browsing', function() {
Browsing.onUserEnter = function(data) {
var activeEl = $('.thread_active_users');
var user = activeEl.find('a[data-uid="' + data.uid + '"]');
if (!user.length && activeEl.children().length < 10) {
if (!user.length && activeEl.first().children().length < 10) {
addUserIcon(data);
} else if (user.length) {
user.attr('data-count', parseInt(user.attr('data-count'), 10) + 1);