(pop, anchor)
| 5964 | } |
| 5965 | |
| 5966 | function positionPopover(pop, anchor) { |
| 5967 | if (!anchor) return; |
| 5968 | const rect = anchor.getBoundingClientRect(); |
| 5969 | pop.style.display = "block"; |
| 5970 | pop.style.visibility = "hidden"; |
| 5971 | |
| 5972 | const { width: pw, height: ph } = pop.getBoundingClientRect(); |
| 5973 | let left = rect.left + rect.width - pw; |
| 5974 | let top = rect.bottom + 8; |
| 5975 | const padding = 8; |
| 5976 | |
| 5977 | left = Math.min(Math.max(padding, left), window.innerWidth - pw - padding); |
| 5978 | top = Math.min(Math.max(padding, top), window.innerHeight - ph - padding); |
| 5979 | |
| 5980 | pop.style.left = `${left}px`; |
| 5981 | pop.style.top = `${top}px`; |
| 5982 | pop.style.visibility = "visible"; |
| 5983 | } |
| 5984 | |
| 5985 | function showViewOptionsPopover(triggerBtn) { |
| 5986 | const pop = ensureViewOptionsPopover(); |
no outgoing calls
no test coverage detected