This PR improves navigation within lightboxes that contain multiple images.
Currently, if a gallery contains multiple large images, and you click on the one currently displayed, two things happen.
- we zoom in
- we navigate to the next image
So, you get taken to the next image, and it shows zoomed in, even when the intention was to zoom in on the previous image.
Magnific popup has an option to disable image-click navigation in galleries. This PR toggles that on.
The result is that if you click on an image in a gallery, we zoom in on that image instead of navigating to the next one.
This has no impact on arrow/keyboard navigation.
Magnific popup also has an API when images change; we reset the zoom class when that happens. So, when you navigate to the next image, it won’t be zoomed in.
I used jQuery for this because both Magnific popup and our implementation for this are based on jQuery. No point making a few lines use vanilla for this when the rest doesn’t.