This commit is contained in:
barisusakli
2016-02-01 21:22:36 +02:00
parent 97c42de2d3
commit 5e86d9f804
2 changed files with 10 additions and 5 deletions

View File

@@ -380,8 +380,15 @@ define('forum/chats', ['components', 'string', 'sounds', 'forum/infinitescroll',
app.updateUserStatus($('.chats-list [data-uid="' + data.uid + '"] [component="user/status"]'), data.status);
});
socket.on('event:chats.edit', function(data) {
Chats.onChatEdit();
socket.on('event:chats.roomRename', function(data) {
$('[component="chat/room/name"]').val(data.newName);
});
};
Chats.onChatEdit = function() {
socket.on('event:chats.edit', function(data) {
data.messages.forEach(function(message) {
templates.parse('partials/chat_message', {
messages: message
@@ -394,10 +401,6 @@ define('forum/chats', ['components', 'string', 'sounds', 'forum/infinitescroll',
});
});
});
socket.on('event:chats.roomRename', function(data) {
$('[component="chat/room/name"]').val(data.newName);
});
};
Chats.resizeMainWindow = function() {

View File

@@ -92,6 +92,8 @@ define('chat', ['components', 'taskbar', 'string', 'sounds', 'forum/chats', 'tra
socket.on('event:chats.roomRename', function(data) {
module.getModal(data.roomId).find('[component="chat/room/name"]').val(data.newName);
});
Chats.onChatEdit();
};
module.loadChatsDropdown = function(chatsListEl) {