added a new component shortcut and updated title setting logic

v1.18.x
Julian Lam 7 years ago
parent dee18d8442
commit 82bfd6edfd

@ -410,7 +410,10 @@ define('forum/chats', [
messages.onChatMessageEdit();
socket.on('event:chats.roomRename', function (data) {
$('[component="chat/room/name"]').val($('<div/>').html(data.newName).text());
var roomEl = components.get('chat/recent/room', data.roomId);
var titleEl = roomEl.find('[component="chat/title"]');
titleEl.text(data.newName);
});
};

@ -50,9 +50,14 @@ define('components', function () {
'chat/message': function (messageId) {
return $('[component="chat/message"][data-mid="' + messageId + '"]');
},
'chat/message/body': function (messageId) {
return $('[component="chat/message"][data-mid="' + messageId + '"] [component="chat/message/body"]');
},
'chat/recent/room': function (roomid) {
return $('[component="chat/recent/room"][data-roomid="' + roomid + '"]');
},
};
components.get = function () {

Loading…
Cancel
Save