File tree Expand file tree Collapse file tree 2 files changed +11
-29
lines changed
app/code/Magento/Catalog/view/frontend/templates/product/view Expand file tree Collapse file tree 2 files changed +11
-29
lines changed Original file line number Diff line number Diff line change 12
12
* @var $block \Magento\Catalog\Block\Product\View\Gallery
13
13
*/
14
14
?>
15
+
16
+ <?php $ images = $ block ->getGalleryImages ()->toArray ()['items ' ] ?>
17
+
15
18
<div class="gallery-placeholder _block-content-loading" data-gallery-role="gallery-placeholder">
16
- <div data-role="loader" class="loading-mask">
17
- <div class="loader">
18
- <img src="<?= /* @escapeNotVerified */ $ block ->getViewFileUrl ('images/loader-1.gif ' ) ?> "
19
- alt="<?= /* @escapeNotVerified */ __ ('Loading... ' ) ?> ">
20
- </div>
21
- </div>
19
+ <img
20
+ class="gallery-placeholder__image"
21
+ src="<?= $ images [0 ]['medium_image_url ' ] ?> "
22
+ />
22
23
</div>
23
- <!--Fix for jumping content. Loader must be the same size as gallery.-->
24
- <script>
25
- var config = {
26
- "width": <?= /* @escapeNotVerified */ $ block ->getImageAttribute ('product_page_image_medium ' , 'width ' ) ?> ,
27
- "thumbheight": <?php /* @escapeNotVerified */ echo $ block ->getImageAttribute ('product_page_image_small ' , 'height ' )
28
- ?: $ block ->getImageAttribute ('product_page_image_small ' , 'width ' ); ?> ,
29
- "navtype": "<?= /* @escapeNotVerified */ $ block ->getVar ("gallery/navtype " ) ?> ",
30
- "height": <?= /* @escapeNotVerified */ $ block ->getImageAttribute ('product_page_image_medium ' , 'height ' ) ?>
31
- },
32
- thumbBarHeight = 0,
33
- loader = document.querySelectorAll('[data-gallery-role="gallery-placeholder"] [data-role="loader"]')[0];
34
24
35
- if (config.navtype === 'horizontal') {
36
- thumbBarHeight = config.thumbheight;
37
- }
38
-
39
- loader.style.paddingBottom = ( config.height / config.width * 100) + "%";
40
- </script>
41
25
<script type="text/x-magento-init">
42
26
{
43
27
"[data-gallery-role=gallery-placeholder]": {
Original file line number Diff line number Diff line change 976
976
977
977
// While first time init
978
978
.gallery-placeholder {
979
- .loading-mask {
980
- padding : 0 0 50% ;
981
- position : static ;
982
- }
983
- .loader img {
984
- position : absolute ;
979
+ &__image {
980
+ display : block ;
981
+ margin : auto ;
985
982
}
986
983
}
987
984
1002
999
display : block ;
1003
1000
}
1004
1001
}
1002
+
1005
1003
.fotorama__product-video--loaded {
1006
1004
.fotorama__img , .fotorama__img--full {
1007
1005
display : none !important ;
You can’t perform that action at this time.
0 commit comments