@nodebb/nodebb-plugin-reactions 2.1.6 → 2.1.8
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 +14 -7
package/package.json
CHANGED
package/public/client.js
CHANGED
|
@@ -217,8 +217,18 @@ $(document).ready(function () {
|
|
|
217
217
|
|
|
218
218
|
function createReactionTooltips() {
|
|
219
219
|
require(['bootstrap', 'translator'], function (bootstrap, translator) {
|
|
220
|
+
function disposeTooltip(el) {
|
|
221
|
+
if (el && el.length) {
|
|
222
|
+
const tooltip = bootstrap.Tooltip.getInstance(el.get(0));
|
|
223
|
+
if (tooltip) {
|
|
224
|
+
tooltip.dispose();
|
|
225
|
+
el.attr('title', '');
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
}
|
|
220
229
|
async function createTooltip(data) {
|
|
221
230
|
const el = mouseOverReactionEl;
|
|
231
|
+
disposeTooltip(el);
|
|
222
232
|
let usernames = data.usernames.filter(name => name !== '[[global:former_user]]');
|
|
223
233
|
if (!usernames.length) {
|
|
224
234
|
return;
|
|
@@ -255,15 +265,17 @@ $(document).ready(function () {
|
|
|
255
265
|
if (mouseOverReactionEl && mouseOverReactionEl.length) {
|
|
256
266
|
const pid = mouseOverReactionEl.attr('data-pid');
|
|
257
267
|
const mid = mouseOverReactionEl.attr('data-mid');
|
|
268
|
+
const reaction = mouseOverReactionEl.attr('data-reaction');
|
|
258
269
|
const type = pid ? 'post' : 'message';
|
|
259
270
|
const data = await socket.emit('plugins.reactions.getReactionUsernames', {
|
|
260
271
|
type: type,
|
|
261
272
|
mid: mid,
|
|
262
273
|
pid: pid,
|
|
263
|
-
reaction:
|
|
274
|
+
reaction: reaction,
|
|
264
275
|
});
|
|
265
276
|
|
|
266
277
|
if (mouseOverReactionEl && mouseOverReactionEl.length &&
|
|
278
|
+
reaction === mouseOverReactionEl.attr('data-reaction') &&
|
|
267
279
|
(
|
|
268
280
|
(type === 'post' && pid === mouseOverReactionEl.attr('data-pid')) ||
|
|
269
281
|
(type === 'message' && mid === mouseOverReactionEl.attr('data-mid'))
|
|
@@ -277,12 +289,7 @@ $(document).ready(function () {
|
|
|
277
289
|
$('#content').on('mouseleave', '.reaction', function () {
|
|
278
290
|
clearTooltipTimeout();
|
|
279
291
|
mouseOverReactionEl = null;
|
|
280
|
-
|
|
281
|
-
const tooltip = bootstrap.Tooltip.getInstance(this);
|
|
282
|
-
if (tooltip) {
|
|
283
|
-
tooltip.dispose();
|
|
284
|
-
$this.attr('title', '');
|
|
285
|
-
}
|
|
292
|
+
disposeTooltip($(this));
|
|
286
293
|
});
|
|
287
294
|
}
|
|
288
295
|
});
|