Skip to content

Commit

Permalink
MAGETWO-57210: [github #6195, 4101] Gallery doesn't show all images a…
Browse files Browse the repository at this point in the history
…dded to configurable options
  • Loading branch information
Denys Rul committed Oct 6, 2016
1 parent 27f620e commit 865afba
Showing 1 changed file with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -268,26 +268,26 @@ define([
*/
_changeProductImage: function () {
var images,
initialImages = $.extend(true, [], this.options.mediaGalleryInitial),
initialImages = this.options.mediaGalleryInitial,
galleryObject = $(this.options.mediaGallerySelector).data('gallery');

if (!galleryObject) {
return;
}

if (this.options.spConfig.images[this.simpleProduct]) {
images = $.extend(true, [], this.options.spConfig.images[this.simpleProduct]);
}
images = this.options.spConfig.images[this.simpleProduct];

if (images) {
images.forEach(function (img) {
img.type = 'image';
});

if (this.options.gallerySwitchStrategy === 'prepend') {
images = images.concat(initialImages);
}

images = $.extend(true, [], images);

images.forEach(function (img) {
img.type = 'image';
});

galleryObject.updateData(images);
} else {
galleryObject.updateData(initialImages);
Expand Down

0 comments on commit 865afba

Please sign in to comment.