'use strict'; /* globals define, app, translator, config, socket, ajaxify */ define('forum/topic/browsing', function() { var Browsing = {}; Browsing.onUpdateUsersInRoom = function(data) { if (data && data.room.indexOf('topic_' + ajaxify.variables.get('topic_id')) !== -1) { $('[component="topic/browsing/list"]').parent().toggleClass('hidden', !data.users.length); for(var i=0; i'); } } function updateUserCount(count) { count = parseInt(count, 10); if (!count || count < 0) { count = 0; } $('[component="topic/browsing/count"]').text(count).parent().toggleClass('hidden', count === 0); } function increaseUserCount(incr) { updateUserCount(parseInt($('[component="topic/browsing/count"]').first().text(), 10) + incr); } return Browsing; });