feat: #7096, improve chat editing

use a new template for editing chats,
remove the data-mid on the chat inputEl
This commit is contained in:
Barış Soner Uşaklı
2023-04-29 20:32:09 -04:00
parent e0f0c08a98
commit eb0c77fd69
5 changed files with 100 additions and 52 deletions

View File

@@ -379,7 +379,7 @@ define('forum/chats', [
});
};
Chats.createAutoComplete = function (roomId, element) {
Chats.createAutoComplete = function (roomId, element, options = {}) {
if (!element.length) {
return;
}
@@ -395,12 +395,17 @@ define('forum/chats', [
},
placement: 'top',
className: `chat-autocomplete-dropdown-${roomId} dropdown-menu textcomplete-dropdown`,
...options,
},
};
$(window).trigger('chat:autocomplete:init', data);
if (data.strategies.length) {
Chats.activeAutocomplete[roomId] = autocomplete.setup(data);
const autocompleteEl = autocomplete.setup(data);
if (roomId) {
Chats.activeAutocomplete[roomId] = autocompleteEl;
}
return autocompleteEl;
}
};