diff --git a/lib/web/magnifier/magnify.js b/lib/web/magnifier/magnify.js index 1e5073d5766b0..15dfc29d75772 100644 --- a/lib/web/magnifier/magnify.js +++ b/lib/web/magnifier/magnify.js @@ -29,6 +29,7 @@ define([ hideMagnifier, dragFlag, endX, + transitionActive = false, allowZoomOut = false, allowZoomIn = true; @@ -201,6 +202,7 @@ define([ ratio; if ($(gallerySelector).data('fotorama').fullScreen) { + transitionActive = true; $imageContainer = $image.parent(); containerWidth = $imageContainer.width(); containerHeight = $imageContainer.height(); @@ -272,7 +274,7 @@ define([ ratio, dimentions = {}; - if (allowZoomIn) { + if (allowZoomIn && !transitionActive) { $image = $(fullscreenImageSelector); imgOriginalSize = getImageSize($image[0].src); @@ -345,7 +347,7 @@ define([ ratio, fitIntoParent; - if (allowZoomOut) { + if (allowZoomOut && !transitionActive) { allowZoomIn = true; $image = $(fullscreenImageSelector); parentWidth = $image.parent().width(); @@ -674,6 +676,11 @@ define([ } }); + $image.off('transitionend webkitTransitionEnd'); + $image.on('transitionend webkitTransitionEnd', function () { + transitionActive = false; + }); + if (keyboardNavigation) { $(document).unbind('keydown', keyboardNavigation); }