From 80c1ce8d85ef2ab0f069fe07e0fc6ce8730684ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Soner=20U=C5=9Fakl=C4=B1?= Date: Thu, 29 Sep 2022 12:51:50 -0400 Subject: [PATCH] fix: if no voters clear tooltip --- public/src/client/topic/votes.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/public/src/client/topic/votes.js b/public/src/client/topic/votes.js index 8109d18a0e..74402df1e4 100644 --- a/public/src/client/topic/votes.js +++ b/public/src/client/topic/votes.js @@ -31,8 +31,8 @@ define('forum/topic/votes', [ } function createTooltip(el, data) { + const tooltip = bootstrap.Tooltip.getInstance(el); function doCreateTooltip(title) { - const tooltip = bootstrap.Tooltip.getInstance(el); if (tooltip) { tooltip.setContent({ '.tooltip-inner': title }); } else { @@ -44,6 +44,10 @@ define('forum/topic/votes', [ let usernames = data.usernames .filter(name => name !== '[[global:former_user]]'); if (!usernames.length) { + if (tooltip) { + tooltip.dispose(); + } + el.attr('title', ''); return; } if (usernames.length + data.otherCount > 6) {