Created
May 8, 2020 14:43
-
-
Save torunar/ffe0b90cfbd6edb8cfa213040c121978 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/design/themes/responsive/templates/addons/image_zoom/hooks/index/scripts.post.tpl b/design/themes/responsive/templates/addons/image_zoom/hooks/index/scripts.post.tpl | |
index fc27386469..9807196a49 100644 | |
--- a/design/themes/responsive/templates/addons/image_zoom/hooks/index/scripts.post.tpl | |
+++ b/design/themes/responsive/templates/addons/image_zoom/hooks/index/scripts.post.tpl | |
@@ -3,7 +3,7 @@ | |
<script type="application/javascript"> | |
(function (_, $) { | |
- $.ceEvent('on', 'ce.commoninit', function (context) { | |
+ $.ceEvent('on', 'ce.responsive_classes.ready', function () { | |
var positionId = {$addons.image_zoom.cz_zoom_position}; | |
if ('{$language_direction}' === 'rtl') { | |
positionId = $.ceImageZoom('translateFlyoutPositionToRtl', positionId); | |
@@ -11,19 +11,17 @@ | |
var $body = $('body', _.doc); | |
- $('.cm-previewer', context).each(function (i, elm) { | |
- setTimeout(function() { | |
- var isMobile = $body.hasClass('screen--xs') || | |
- $body.hasClass('screen--xs-large') || | |
- $body.hasClass('screen--sm') || | |
- $body.hasClass('screen--sm-large'); | |
+ $('.cm-previewer').each(function (i, elm) { | |
+ var isMobile = $body.hasClass('screen--xs') || | |
+ $body.hasClass('screen--xs-large') || | |
+ $body.hasClass('screen--sm') || | |
+ $body.hasClass('screen--sm-large'); | |
- if (isMobile && Modernizr.touchevents) { | |
- return false; | |
- } | |
+ if (isMobile && Modernizr.touchevents) { | |
+ return false; | |
+ } | |
- $.ceImageZoom('init', $(elm), positionId); | |
- }, 220); | |
+ $.ceImageZoom('init', $(elm), positionId); | |
}); | |
}); | |
})(Tygh, Tygh.$); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment