This commit is contained in:
Renan LE CARO 2025-05-03 16:42:03 +02:00
parent ca1c75a5a1
commit 94ffb80f49
19 changed files with 186 additions and 73 deletions

View file

@ -19,12 +19,14 @@ function setupMobileTooltips(tooltip: HTMLDivElement) {
console.log("openTooltip", e);
hideAnyTooltip();
const hovering = e.target as HTMLElement;
if (!hovering?.hasAttribute("data-help-content")) {
const tooltipContent =
hovering?.getAttribute("data-help-content")?.trim() || "";
if (!tooltipContent) {
return;
}
e.stopPropagation();
e.preventDefault();
tooltip.innerHTML = hovering.getAttribute("data-help-content") || "";
tooltip.innerHTML = tooltipContent;
tooltip.style.display = "";
const { top } = hovering.getBoundingClientRect();
tooltip.style.transform = `translate(0,${top}px) translate(0,-100%)`;