Place mobile modal above button

This commit is contained in:
2026-03-25 17:12:50 +01:00
parent 19b66f7754
commit c60a9bd861
2 changed files with 12 additions and 12 deletions

View File

@@ -52,8 +52,13 @@ const positionPrivacyFlyover = (trigger) => {
const panelHeight = privacyFlyoverPanel.offsetHeight;
if (isMobile) {
privacyFlyover.style.removeProperty("--privacy-flyover-top");
privacyFlyover.style.removeProperty("--privacy-flyover-left");
const panelWidth = window.innerWidth - 40;
const left = 20;
const top = Math.max(gap, rect.top - panelHeight - gap);
privacyFlyover.style.setProperty("--privacy-flyover-left", `${left}px`);
privacyFlyover.style.setProperty("--privacy-flyover-top", `${top}px`);
privacyFlyover.style.setProperty("--privacy-flyover-width", `${panelWidth}px`);
return;
}
@@ -66,6 +71,7 @@ const positionPrivacyFlyover = (trigger) => {
privacyFlyover.style.setProperty("--privacy-flyover-left", `${left}px`);
privacyFlyover.style.setProperty("--privacy-flyover-top", `${top}px`);
privacyFlyover.style.removeProperty("--privacy-flyover-width");
};
const closeFlyover = () => {