MCPcopy Index your code
hub / github.com/cifertech/DisplayKit / openContextMenu

Function openContextMenu

app.js:4948–4959  ·  view source on GitHub ↗
(x, y)

Source from the content-addressed store, hash-verified

4946}
4947
4948function openContextMenu(x, y) {
4949 if (!contextMenu) return;
4950 contextMenu.classList.add("open");
4951 contextMenu.setAttribute("aria-hidden", "false");
4952 const pad = 8;
4953 const w = contextMenu.offsetWidth || 200;
4954 const h = contextMenu.offsetHeight || 220;
4955 const maxX = window.innerWidth - w - pad;
4956 const maxY = window.innerHeight - h - pad;
4957 contextMenu.style.left = clamp(x, pad, maxX) + "px";
4958 contextMenu.style.top = clamp(y, pad, maxY) + "px";
4959}
4960
4961function closeContextMenu() {
4962 if (!contextMenu) return;

Callers 1

app.jsFile · 0.85

Calls 1

clampFunction · 0.70

Tested by

no test coverage detected