diff --git a/public/src/modules/chat.js b/public/src/modules/chat.js
index 2d364b0f8f..7555a380e5 100644
--- a/public/src/modules/chat.js
+++ b/public/src/modules/chat.js
@@ -152,8 +152,7 @@ define('chat', ['components', 'taskbar', 'string', 'sounds', 'forum/chats', 'tra
return;
}
- for(var x = 0; x')
.attr('data-uid', userObj.uid)
.html(''+
@@ -162,16 +161,15 @@ define('chat', ['components', 'taskbar', 'string', 'sounds', 'forum/chats', 'tra
userObj.username + '')
.appendTo(chatsListEl);
- (function(userObj) {
- dropdownEl.click(function() {
- if (!ajaxify.currentPage.match(/^chats\//)) {
- app.openChat(userObj.username, userObj.uid);
- } else {
- ajaxify.go('chats/' + utils.slugify(userObj.username));
- }
- });
- })(userObj);
- }
+
+ dropdownEl.click(function() {
+ if (!ajaxify.currentPage.match(/^chats\//)) {
+ app.openChat(userObj.username, userObj.uid);
+ } else {
+ ajaxify.go('chats/' + utils.slugify(userObj.username));
+ }
+ });
+ });
});
};
@@ -490,8 +488,11 @@ define('chat', ['components', 'taskbar', 'string', 'sounds', 'forum/chats', 'tra
module.sync = function() {
socket.emit('modules.chats.sync', function(err, users) {
- for(var x=0,numUsers=users.length,user;x