@@ -272,8 +272,8 @@ define([
272
272
} ) ,
273
273
mainImageIndex ,
274
274
$element = settings . $element ,
275
- $placeholderImage = $element . find ( '.gallery-placeholder__image' ) ,
276
- $fotoramaElement ;
275
+ $fotoramaElement ,
276
+ $fotoramaStage ;
277
277
278
278
if ( settings . breakpoints ) {
279
279
_ . each ( _ . values ( settings . breakpoints ) , function ( breakpoint ) {
@@ -297,25 +297,25 @@ define([
297
297
) ;
298
298
settings . currentConfig = config ;
299
299
300
- // Adjust wrapper and placeholder styling just before initializing the gallery.
301
- $placeholderImage . css ( {
302
- position : 'absolute' ,
303
- left : '50%' ,
304
- transform : 'translateX(-50%)'
305
- } ) ;
306
300
$element
307
301
. css ( 'min-height' , settings . $element . height ( ) )
308
302
. append ( tpl ) ;
309
303
310
304
$fotoramaElement = $element . find ( '[data-gallery-role="gallery"]' ) ;
305
+
306
+ $fotoramaStage = $fotoramaElement . find ( '.fotorama__stage' ) ;
307
+ $fotoramaStage . css ( 'position' , 'absolute' ) ;
308
+
311
309
$fotoramaElement . fotorama ( config ) ;
312
310
$fotoramaElement . find ( '.fotorama__stage__frame.fotorama__active' )
313
311
. one ( 'f:load' , function ( ) {
314
312
// Remove placeholder when main gallery image loads.
315
- $placeholderImage . remove ( ) ;
313
+ $element . find ( '.gallery-placeholder__image' ) . remove ( ) ;
316
314
$element
317
315
. removeClass ( '_block-content-loading' )
318
316
. css ( 'min-height' , '' ) ;
317
+
318
+ $fotoramaStage . css ( 'position' , '' ) ;
319
319
} ) ;
320
320
settings . $elementF = $fotoramaElement ;
321
321
settings . fotoramaApi = $fotoramaElement . data ( 'fotorama' ) ;
0 commit comments