From e592499d48c3112ec24da3ba2f9876dcf1808ff7 Mon Sep 17 00:00:00 2001 From: barisusakli Date: Thu, 30 Jul 2015 15:14:02 -0400 Subject: [PATCH] correctly hide/show user in browsing users --- public/src/app.js | 4 +++- public/src/client/topic/browsing.js | 11 ++++++----- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/public/src/app.js b/public/src/app.js index a14a403da5..650a509eda 100644 --- a/public/src/app.js +++ b/public/src/app.js @@ -185,7 +185,8 @@ app.cacheBuster = null; enter: room, username: app.user.username, userslug: app.user.userslug, - picture: app.user.picture + picture: app.user.picture, + status: app.user.status }, function(err) { if (err) { app.alertError(err.message); @@ -454,6 +455,7 @@ app.cacheBuster = null; return app.alertError(err.message); } $('#logged-in-menu #user_label #user-profile-link>i').attr('class', 'fa fa-circle status ' + status); + app.user.status = status; }); e.preventDefault(); }); diff --git a/public/src/client/topic/browsing.js b/public/src/client/topic/browsing.js index 0bed58f952..9eeb22c9d8 100644 --- a/public/src/client/topic/browsing.js +++ b/public/src/client/topic/browsing.js @@ -4,14 +4,14 @@ /* globals define, app, config, socket, ajaxify */ -define('forum/topic/browsing', ['translator'], function(translator) { +define('forum/topic/browsing', function() { var Browsing = {}; Browsing.onUpdateUsersInRoom = function(data) { if (data && data.room.indexOf('topic_' + ajaxify.data.tid) !== -1) { $('[component="topic/browsing/list"]').parent().toggleClass('hidden', !data.users.length); - for(var i=0; i'); } }