File tree Expand file tree Collapse file tree 5 files changed +42
-23
lines changed
app/code/Magento/Catalog/view/frontend/templates/product/view Expand file tree Collapse file tree 5 files changed +42
-23
lines changed Original file line number Diff line number Diff line change 20
20
</div>
21
21
</div>
22
22
</div>
23
+ <!--Fix for jumping content. Loader must be the same size as gallery.-->
24
+ <script type="text/javascript">
25
+ var config = {
26
+ "width": <?php /* @escapeNotVerified */ echo $ 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": "<?php /* @escapeNotVerified */ echo $ block ->getVar ("gallery/navtype " ); ?> ",
30
+ "height": <?php /* @escapeNotVerified */ echo $ 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
+
35
+ if (config.navtype === 'horizontal') {
36
+ thumbBarHeight = config.thumbheight;
37
+ }
38
+
39
+ loader.style.paddingBottom = ( config.height / config.width * 100) + "%";
40
+ </script>
23
41
<script type="text/x-magento-init">
24
42
{
25
43
"[data-gallery-role=gallery-placeholder]": {
Original file line number Diff line number Diff line change @@ -89,8 +89,8 @@ fotoramaVersion = '4.6.4';
89
89
90
90
horizontalImageClass = _fotoramaClass + '_horizontal_ratio' ,
91
91
verticalImageClass = _fotoramaClass + '_vertical_ratio' ,
92
-
93
- spinnerShowClass = _fotoramaClass + '_spinner ' ;
92
+ fotoramaSpinnerClass = _fotoramaClass + '__spinner' ,
93
+ spinnerShowClass = fotoramaSpinnerClass + '--show ' ;
94
94
var JQUERY_VERSION = $ && $ . fn . jquery . split ( '.' ) ;
95
95
96
96
if ( ! JQUERY_VERSION
@@ -1781,7 +1781,7 @@ fotoramaVersion = '4.6.4';
1781
1781
$videoClose = $fotorama . find ( cls ( videoCloseClass ) ) ,
1782
1782
videoClose = $videoClose [ 0 ] ,
1783
1783
1784
- $spinner = $fotorama . find ( '.fotorama_spin' ) ,
1784
+ $spinner = $fotorama . find ( cls ( fotoramaSpinnerClass ) ) ,
1785
1785
1786
1786
$videoPlaying ,
1787
1787
Original file line number Diff line number Diff line change 20
20
< div class ="fotorama__video-close "> </ div >
21
21
< div class ="fotorama__zoom-in " data-gallery-role ="fotorama__zoom-in " aria-label ="Zoom in " role ="button " tabindex ="0 "> </ div >
22
22
< div class ="fotorama__zoom-out " data-gallery-role ="fotorama__zoom-out " aria-label ="Zoom out " role ="button " tabindex ="0 "> </ div >
23
- < div class ="fotorama_spin "> </ div >
23
+ < div class ="fotorama__spinner "> </ div >
24
24
</ div >
25
25
< div class ="fotorama__nav-wrap " data-gallery-role ="nav-wrap ">
26
26
< div class ="fotorama__nav fotorama__nav--thumbs ">
Original file line number Diff line number Diff line change 13
13
@import ' module/_focus.less' ;
14
14
@import ' module/_fullscreen.less' ;
15
15
16
- .fotorama_spin {
17
- display : none ;
18
- & .fotorama_spinner {
19
- display : block ;
20
- width : 64px ;
21
- height : 64px ;
22
- background-image : url(' @{baseDir} ../images/loader-1.gif' ) ;
23
- bottom : 0 ;
24
- left : 0 ;
25
- margin : auto ;
26
- position : absolute ;
27
- right : 0 ;
28
- top : 0 ;
29
- z-index : @z-index-1 ;
30
- }
31
- }
32
-
33
16
.fotorama__zoom-in ,
34
17
.fotorama__zoom-out {
35
18
display : none ;
983
966
.gallery-placeholder {
984
967
.loading-mask {
985
968
padding : 0 0 50% ;
986
- position : absolute ;
969
+ position : static ;
987
970
}
988
971
.loader img {
989
972
position : absolute ;
1003
986
}
1004
987
}
1005
988
989
+ // Styles for spinner in gallery.
990
+ .fotorama__spinner {
991
+ display : none ;
992
+ width : @fotorama-spinner-size ;
993
+ height : @fotorama-spinner-size ;
994
+ background-image : url(' @{baseDir} ../images/loader-1.gif' ) ;
995
+ bottom : 0 ;
996
+ left : 0 ;
997
+ margin : auto ;
998
+ position : absolute ;
999
+ right : 0 ;
1000
+ top : 0 ;
1001
+ z-index : @z-index-1 ;
1002
+ & .fotorama__spinner--show {
1003
+ display : block ;
1004
+ }
1005
+ }
Original file line number Diff line number Diff line change 9
9
@size-fotorama-block : 80px ;
10
10
@fotorama-thumb-arrow : 30px ;
11
11
@fotorama-fullscreen-zoom-time : 0.3s ;
12
- @fotorama-inner-box-shadow : 3px ;
12
+ @fotorama-inner-box-shadow : 3px ;
13
+ @fotorama-spinner-size : 64px ;
You can’t perform that action at this time.
0 commit comments