mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-16 18:56:15 +01:00
added a new component shortcut and updated title setting logic
This commit is contained in:
@@ -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 () {
|
||||
|
||||
Reference in New Issue
Block a user