MCPcopy Create free account
hub / github.com/error311/FileRise / positionPopover

Function positionPopover

public/js/fileListView.js:5966–5983  ·  view source on GitHub ↗
(pop, anchor)

Source from the content-addressed store, hash-verified

5964}
5965
5966function 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
5985function showViewOptionsPopover(triggerBtn) {
5986 const pop = ensureViewOptionsPopover();

Callers 1

showViewOptionsPopoverFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected