nodebb-plugin-admin-chats 3.4.2 → 3.4.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/client.js +13 -3
- package/package.json +1 -1
package/client.js
CHANGED
|
@@ -244,11 +244,21 @@ $(document).ready(function() {
|
|
|
244
244
|
mainWrapper.find('[data-bs-toggle="tooltip"]').tooltip({ trigger: 'hover', container: '#content' });
|
|
245
245
|
Chats.setActive(roomId);
|
|
246
246
|
Chats.addEventListeners();
|
|
247
|
-
//
|
|
248
|
-
//
|
|
249
|
-
$(window).
|
|
247
|
+
// Fire through the hooks module like core does — a raw jQuery
|
|
248
|
+
// trigger never reaches hooks.on() listeners (e.g. the reactions
|
|
249
|
+
// plugin), only legacy $(window).on() ones (e.g. the emoji plugin).
|
|
250
|
+
// hooks.fire invokes both kinds and passes the container.
|
|
251
|
+
require(['hooks'], function(hooks) {
|
|
252
|
+
hooks.fire('action:chat.loaded', $('.chats-full'));
|
|
253
|
+
});
|
|
250
254
|
if (roomId) {
|
|
251
255
|
ChatsMessages.scrollToBottomAfterImageLoad(mainWrapper.find('[component="chat/message/content"]'));
|
|
256
|
+
// Core only marks a room read when its list element carries the
|
|
257
|
+
// "unread" class — the admin list doesn't, so mark it explicitly
|
|
258
|
+
require(['api'], function(api) {
|
|
259
|
+
api.del(`/chats/${roomId}/state`, {}).catch(function() {});
|
|
260
|
+
});
|
|
261
|
+
$('[component="chat/nav-wrapper"]').find(`[data-roomid="${roomId}"]`).removeClass('unread');
|
|
252
262
|
}
|
|
253
263
|
if (history.pushState) {
|
|
254
264
|
const fullUrl = `${window.location.protocol}//${window.location.host}${config.relative_path || ''}/${url}`;
|