Skip to content

Commit

Permalink
fix(storefront): BCTHEME-37 Cornerstone - Image Zoom Does Not Work on…
Browse files Browse the repository at this point in the history
… Internet Explorer (#1923)
  • Loading branch information
yurytut1993 committed Dec 9, 2020
1 parent c58cbeb commit 9083ea3
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Changelog

## Draft
- Cornerstone - Image Zoom Does Not Work on Internet Explorer. [#1923](https://github.com/bigcommerce/cornerstone/pull/1923)
- Parse HTML entities in jsContext. [#1917](https://github.com/bigcommerce/cornerstone/pull/1917)
- Product images squashed in Category view in AMP. [#1921](https://github.com/bigcommerce/cornerstone/pull/1921)
- Fixed misaligned tooltip for required product option. [#1915](https://github.com/bigcommerce/cornerstone/pull/1915)
Expand Down
12 changes: 8 additions & 4 deletions assets/js/theme/product/image-gallery.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,14 @@ export default class ImageGallery {
}

checkImage() {
const containerHeight = $('.productView-image').height();
const containerWidth = $('.productView-image').width();
const height = this.easyzoom.data('easyZoom').$zoom.context.height;
const width = this.easyzoom.data('easyZoom').$zoom.context.width;
const $imageContainer = $('.productView-image');
const containerHeight = $imageContainer.height();
const containerWidth = $imageContainer.width();

const $image = this.easyzoom.data('easyZoom').$zoom;
const height = $image.height();
const width = $image.width();

if (height < containerHeight || width < containerWidth) {
this.easyzoom.data('easyZoom').hide();
}
Expand Down
2 changes: 2 additions & 0 deletions assets/scss/components/stencil/productView/_productView.scss
Original file line number Diff line number Diff line change
Expand Up @@ -422,6 +422,8 @@
.productView-image .easyzoom-flyout {
overflow: hidden;
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;

Expand Down

0 comments on commit 9083ea3

Please sign in to comment.