From 53bfe5955dd6b2d4f5e65c56826c0177c7f70875 Mon Sep 17 00:00:00 2001 From: Mischa Date: Sun, 21 Jun 2026 21:45:22 +0200 Subject: [PATCH] fix(photoswipe): target currSlide.container not currSlide.el MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit pswp.currSlide is a Slide instance whose DOM element is stored as .container (.pswp__zoom-wrap). The .el property belongs to the itemHolder wrapper, not the Slide — so currSlide.el was always undefined, the null-guard exited early, and no animation played. Co-Authored-By: Claude Sonnet 4.6 Claude-Session: https://claude.ai/code/session_01Vgmzx8VTTTmCskSpQtsLTr --- themes/intotheeast/templates/dailies.html.twig | 2 +- themes/intotheeast/templates/home.html.twig | 2 +- themes/intotheeast/templates/trip.html.twig | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/themes/intotheeast/templates/dailies.html.twig b/themes/intotheeast/templates/dailies.html.twig index e151acd..22eed21 100644 --- a/themes/intotheeast/templates/dailies.html.twig +++ b/themes/intotheeast/templates/dailies.html.twig @@ -124,7 +124,7 @@ lightbox.on('afterOpen', function () { if (!keyDir) return; var dir = keyDir; keyDir = 0; - var el = pswp.currSlide && pswp.currSlide.el; + var el = pswp.currSlide && pswp.currSlide.container; if (!el) return; el.classList.remove('pswp-key-from-left', 'pswp-key-from-right'); el.offsetWidth; diff --git a/themes/intotheeast/templates/home.html.twig b/themes/intotheeast/templates/home.html.twig index a72380a..cf4204d 100644 --- a/themes/intotheeast/templates/home.html.twig +++ b/themes/intotheeast/templates/home.html.twig @@ -159,7 +159,7 @@ lightbox.on('afterOpen', function () { if (!keyDir) return; var dir = keyDir; keyDir = 0; - var el = pswp.currSlide && pswp.currSlide.el; + var el = pswp.currSlide && pswp.currSlide.container; if (!el) return; el.classList.remove('pswp-key-from-left', 'pswp-key-from-right'); el.offsetWidth; diff --git a/themes/intotheeast/templates/trip.html.twig b/themes/intotheeast/templates/trip.html.twig index 51bcab9..83dc042 100644 --- a/themes/intotheeast/templates/trip.html.twig +++ b/themes/intotheeast/templates/trip.html.twig @@ -528,10 +528,10 @@ lightbox.on('afterOpen', function () { if (!keyDir) return; var dir = keyDir; keyDir = 0; - var el = pswp.currSlide && pswp.currSlide.el; + var el = pswp.currSlide && pswp.currSlide.container; if (!el) return; el.classList.remove('pswp-key-from-left', 'pswp-key-from-right'); - el.offsetWidth; // restart animation if navigating rapidly + el.offsetWidth; el.classList.add(dir > 0 ? 'pswp-key-from-right' : 'pswp-key-from-left'); clearTimeout(clearTimer); clearTimer = setTimeout(function () { el.classList.remove('pswp-key-from-left', 'pswp-key-from-right'); }, 400);