update frame
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user