@nodebb/nodebb-plugin-reactions 2.1.9 → 2.1.10
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/package.json +1 -1
- package/public/client.js +8 -6
package/package.json
CHANGED
package/public/client.js
CHANGED
|
@@ -15,9 +15,11 @@ $(document).ready(function () {
|
|
|
15
15
|
}
|
|
16
16
|
});
|
|
17
17
|
// switchChat uses action:chat.loaded and not action:ajaxify.end
|
|
18
|
-
hooks.on('action:chat.loaded', function () {
|
|
18
|
+
hooks.on('action:chat.loaded', function (container) {
|
|
19
19
|
if (ajaxify.data.template.chats && ajaxify.data.roomId) {
|
|
20
|
-
setupMessageReactions();
|
|
20
|
+
setupMessageReactions(container);
|
|
21
|
+
} else if (container.hasClass('chat-modal')) {
|
|
22
|
+
setupMessageReactions(container);
|
|
21
23
|
}
|
|
22
24
|
});
|
|
23
25
|
});
|
|
@@ -81,10 +83,10 @@ $(document).ready(function () {
|
|
|
81
83
|
});
|
|
82
84
|
}
|
|
83
85
|
|
|
84
|
-
function setupMessageReactions() {
|
|
86
|
+
function setupMessageReactions(container) {
|
|
85
87
|
setupMessageReactionSockets();
|
|
86
88
|
|
|
87
|
-
const messageContent =
|
|
89
|
+
const messageContent = container.find('[component="chat/message/content"]');
|
|
88
90
|
messageContent.on('click', '[component="message/reaction"]', function () {
|
|
89
91
|
var reactionElement = $(this);
|
|
90
92
|
var mid = reactionElement.attr('data-mid');
|
|
@@ -257,7 +259,7 @@ $(document).ready(function () {
|
|
|
257
259
|
}
|
|
258
260
|
|
|
259
261
|
if (!utils.isTouchDevice()) {
|
|
260
|
-
$('
|
|
262
|
+
$('body').on('mouseenter', '.reaction', function () {
|
|
261
263
|
const $this = $(this);
|
|
262
264
|
mouseOverReactionEl = $this;
|
|
263
265
|
clearTooltipTimeout();
|
|
@@ -286,7 +288,7 @@ $(document).ready(function () {
|
|
|
286
288
|
}
|
|
287
289
|
}, 200);
|
|
288
290
|
});
|
|
289
|
-
$('
|
|
291
|
+
$('body').on('mouseleave', '.reaction', function () {
|
|
290
292
|
clearTooltipTimeout();
|
|
291
293
|
mouseOverReactionEl = null;
|
|
292
294
|
disposeTooltip($(this));
|