post tooltips: fix tooltips appearing over one another.

When viewing a list of post #XXX links, like this:

* post #123
* post #456
* post #789

Then moving from bottom to top could cause multiple tooltips to appear
over one another. This was because tippy.js tries to keep tooltips
active while moving towards them, which meant it was possible to
activate a second tooltip while moving towards the first.
This commit is contained in:
evazion
2020-07-16 12:53:08 -05:00
parent ce61202d14
commit 87b6f59bf0

View File

@@ -49,6 +49,8 @@ PostTooltip.on_show = async function (instance) {
let $target = $(instance.reference);
let $tooltip = $(instance.popper);
hideAll({ exclude: instance });
// skip if tooltip has already been rendered.
if ($tooltip.has(".post-tooltip-body").length) {
return;