mirror of
https://github.com/ranaldsgift/KefinTweaks.git
synced 2026-11-05 15:52:47 +01:00
Force Season popover to appear beflow the Select Season button
This commit is contained in:
1 parent
b84c5f5709
commit
b6d17ac0b7
1 file changed
+4
-18
@@ -318,24 +318,10 @@
|
||||
const popover = createPopover();
|
||||
sectionTitleContainer.style.position = 'relative';
|
||||
selectButton.parentNode.insertBefore(popover, selectButton.nextSibling);
|
||||
|
||||
// Check if popover would overflow bottom of viewport
|
||||
const popoverRect = popover.getBoundingClientRect();
|
||||
const viewportHeight = window.innerHeight;
|
||||
const wouldOverflowBottom = popoverRect.bottom > viewportHeight;
|
||||
|
||||
if (wouldOverflowBottom) {
|
||||
popover.style.top = 'auto';
|
||||
popover.style.bottom = '100%';
|
||||
popover.style.marginTop = '0';
|
||||
popover.style.marginBottom = '8px';
|
||||
LOG('Popover positioned above button to avoid overflow');
|
||||
} else {
|
||||
popover.style.top = '100%';
|
||||
popover.style.bottom = 'auto';
|
||||
popover.style.marginTop = '8px';
|
||||
popover.style.marginBottom = '0';
|
||||
}
|
||||
popover.style.top = '100%';
|
||||
popover.style.bottom = 'auto';
|
||||
popover.style.marginTop = '8px';
|
||||
popover.style.marginBottom = '0';
|
||||
|
||||
activePopover = popover;
|
||||
|
||||
|
||||
Reference in new issue
Block a user