From 499c50a485eb6db4b8600f253846591caa909a93 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Soner=20U=C5=9Fakl=C4=B1?= Date: Mon, 13 Oct 2025 13:45:11 -0400 Subject: [PATCH] fix: #13705, don't cover link if preview is opening up --- public/src/client/topic.js | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/public/src/client/topic.js b/public/src/client/topic.js index cce6f1f99a..5ee1f91f60 100644 --- a/public/src/client/topic.js +++ b/public/src/client/topic.js @@ -358,7 +358,6 @@ define('forum/topic', [ const postContent = link.parents('[component="topic"]').find('[component="post/content"]').first(); const postRect = postContent.offset(); const postWidth = postContent.width(); - const linkRect = link.offset(); const { top } = link.get(0).getBoundingClientRect(); const dropup = top > window.innerHeight / 2; tooltip.on('mouseenter', function () { @@ -366,11 +365,16 @@ define('forum/topic', [ }); tooltip.one('mouseleave', destroyTooltip); $(window).off('click', onClickOutside).one('click', onClickOutside); - tooltip.css({ - top: dropup ? linkRect.top - tooltip.outerHeight() : linkRect.top + 30, + const css = { left: postRect.left, width: postWidth, - }); + }; + if (dropup) { + css.bottom = window.innerHeight - top - window.scrollY + 5; + } else { + css.top = top + window.scrollY + 30; + } + tooltip.css(css); } }