Skip to content

Commit

Permalink
Adjust zoomed-in class behaviour to reflect toggleZoom method, #1946
Browse files Browse the repository at this point in the history
  • Loading branch information
dimsemenov committed Jul 22, 2022
1 parent 311ed1f commit 458cb0f
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions src/js/ui/ui.js
Original file line number Diff line number Diff line change
Expand Up @@ -117,16 +117,11 @@ class UI {
}

template.classList.add('pswp--zoom-allowed');
const secondaryIsHigher = (currZoomLevelDiff < 0);

if (currZoomLevel === currSlide.zoomLevels.secondary) {
setZoomedIn(template, secondaryIsHigher);
} else if (currZoomLevel > currSlide.zoomLevels.secondary) {
setZoomedIn(template, true);
} else {
// if (currZoomLevel < currSlide.zoomLevels.secondary)
setZoomedIn(template, false);
}
const potentialZoomLevel = currZoomLevel === currSlide.zoomLevels.initial
? currSlide.zoomLevels.secondary : currSlide.zoomLevels.initial;

setZoomedIn(template, potentialZoomLevel <= currZoomLevel);

if (options.imageClickAction === 'zoom'
|| options.imageClickAction === 'zoom-or-close') {
Expand Down

0 comments on commit 458cb0f

Please sign in to comment.