Skip to content

Commit 5824082

Browse files
ENGCOM-4296: Patch 18017 magento 23 #19635
- Merge Pull Request #19635 from niravkrish/magento2:patch-18017-magento-23 - Merged commits: 1. b92bbc4 2. 95d5f44 3. 30c3eac 4. ee64ecd 5. 7feaedd 6. bbceaab 7. 0611394 8. 41c2d90 9. ec5c01f
2 parents 10f900e + ec5c01f commit 5824082

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

app/code/Magento/Swatches/view/frontend/web/js/swatch-renderer.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1239,6 +1239,11 @@ define([
12391239

12401240
if (!_.isUndefined(gallery)) {
12411241
gallery.updateData(imagesToUpdate);
1242+
} else {
1243+
context.find(this.options.mediaGallerySelector).on('gallery:loaded', function (loadedGallery) {
1244+
loadedGallery = context.find(this.options.mediaGallerySelector).data('gallery');
1245+
loadedGallery.updateData(imagesToUpdate);
1246+
}.bind(this));
12421247
}
12431248

12441249
if (isInitial) {
@@ -1249,6 +1254,7 @@ define([
12491254
dataMergeStrategy: this.options.gallerySwitchStrategy
12501255
});
12511256
}
1257+
12521258
} else if (justAnImage && justAnImage.img) {
12531259
context.find('.product-image-photo').attr('src', justAnImage.img);
12541260
}

0 commit comments

Comments
 (0)