mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-02-25 16:11:19 +01:00
allow editing pinned chat messages
only update message body and edited component
This commit is contained in:
@@ -273,7 +273,13 @@ define('forum/chats/messages', [
|
||||
messages.parseMessage(message, function (html) {
|
||||
const msgEl = components.get('chat/message', message.mid);
|
||||
if (msgEl.length) {
|
||||
msgEl.replaceWith(html);
|
||||
const componentsToReplace = [
|
||||
'[component="chat/message/body"]',
|
||||
'[component="chat/message/edited"]',
|
||||
];
|
||||
componentsToReplace.forEach((cmp) => {
|
||||
msgEl.find(cmp).replaceWith(html.find(cmp));
|
||||
});
|
||||
messages.onMessagesAddedToDom(components.get('chat/message', message.mid));
|
||||
}
|
||||
const parentEl = $(`[component="chat/message/parent"][data-parent-mid="${message.mid}"]`);
|
||||
|
||||
Reference in New Issue
Block a user