File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed
app/code/Magento/Swatches/view/frontend/web/js Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -1223,7 +1223,6 @@ define([
1223
1223
}
1224
1224
1225
1225
imagesToUpdate = this . _setImageIndex ( imagesToUpdate ) ;
1226
-
1227
1226
if ( gallery === undefined ) {
1228
1227
context . find ( this . options . mediaGallerySelector ) . on ( 'gallery:loaded' , function ( loadedGallery ) {
1229
1228
loadedGallery = context . find ( this . options . mediaGallerySelector ) . data ( 'gallery' ) ;
@@ -1242,7 +1241,14 @@ define([
1242
1241
} ) ;
1243
1242
}
1244
1243
1245
- gallery . first ( ) ;
1244
+ if ( gallery === undefined ) {
1245
+ context . find ( this . options . mediaGallerySelector ) . on ( 'gallery:loaded' , function ( loadedGallery ) {
1246
+ loadedGallery = context . find ( this . options . mediaGallerySelector ) . data ( 'gallery' ) ;
1247
+ loadedGallery . first ( ) ;
1248
+ } . bind ( this ) ) ;
1249
+ } else {
1250
+ gallery . first ( ) ;
1251
+ }
1246
1252
1247
1253
} else if ( justAnImage && justAnImage . img ) {
1248
1254
context . find ( '.product-image-photo' ) . attr ( 'src' , justAnImage . img ) ;
You can’t perform that action at this time.
0 commit comments