positionRulePopup function
Last updated: 2026-03-04T23:21:38.396Z
Metrics
LOC: 22
Complexity: 4
Params: 1
Signature
positionRulePopup(anchor: HTMLElement): : void
Source Code
function positionRulePopup(anchor: HTMLElement): void {
if (!rulePopupElement) return;
const rect = anchor.getBoundingClientRect();
const popupWidth = 280;
const popupHeight = 280;
let top = rect.bottom + window.scrollY + 4;
let left = rect.left + window.scrollX;
if (left + popupWidth > window.innerWidth + window.scrollX - 8) {
left = window.innerWidth + window.scrollX - popupWidth - 8;
}
left = Math.max(window.scrollX + 8, left);
if (top + popupHeight > window.innerHeight + window.scrollY) {
top = rect.top + window.scrollY - popupHeight - 4;
}
rulePopupElement.style.top = `${top}px`;
rulePopupElement.style.left = `${left}px`;
}
No outgoing dependencies.
Impact (Incoming)
| Source | Type |
|---|---|
| showRulePopup | calls |