fix: right-click ctx menu never closes — showCtx appended the menu but never stored it in ctxEl, so hideCtx (item click / outside press) was always a no-op; priority page and keys page affected

This commit is contained in:
JianFeeeee
2026-08-11 00:15:16 +08:00
parent 88802f9ef6
commit 6221502adc

View File

@ -2020,6 +2020,7 @@ function showCtx(x, y, items) {
const it = items[+t.dataset.i]; hideCtx(); if (it) it.fn(); const it = items[+t.dataset.i]; hideCtx(); if (it) it.fn();
}); });
document.body.appendChild(w); document.body.appendChild(w);
ctxEl = w;
const r = w.getBoundingClientRect(); const r = w.getBoundingClientRect();
w.style.left = Math.max(6, Math.min(x, window.innerWidth - r.width - 6)) + 'px'; w.style.left = Math.max(6, Math.min(x, window.innerWidth - r.width - 6)) + 'px';
w.style.top = Math.max(6, Math.min(y, window.innerHeight - r.height - 6)) + 'px'; w.style.top = Math.max(6, Math.min(y, window.innerHeight - r.height - 6)) + 'px';