mirror of
https://gitlab.com/lecarore/breakout71.git
synced 2025-06-16 03:05:03 -04:00
wip
This commit is contained in:
parent
ca1c75a5a1
commit
94ffb80f49
19 changed files with 186 additions and 73 deletions
|
@ -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%)`;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue