update frame

This commit is contained in:
2026-04-01 19:26:38 -07:00
parent efe5017740
commit 6c3100b5c9
5 changed files with 303 additions and 75 deletions

View File

@@ -1542,6 +1542,19 @@
event.preventDefault();
}
function preventBrowserZoomGesture(event) {
if (!lightboxState.isOpen) {
return;
}
if (event.type === "wheel" && !event.ctrlKey) {
return;
}
event.preventDefault();
event.stopPropagation();
}
function isPointOnCard(clientX, clientY, targetImage = imageEl, targetFrame = null) {
const frameElForHitTest = targetFrame || targetImage;
if (!targetImage || !frameElForHitTest) {
@@ -2693,6 +2706,17 @@
stepPrimaryCard(event.key === "ArrowRight" ? 1 : -1);
});
document.addEventListener("wheel", preventBrowserZoomGesture, {
capture: true,
passive: false
});
["gesturestart", "gesturechange", "gestureend"].forEach((eventName) => {
document.addEventListener(eventName, preventBrowserZoomGesture, {
capture: true,
passive: false
});
});
window.addEventListener("resize", () => {
if (!lightboxState.isOpen) {
return;