Skip to content

Commit

Permalink
JS-323: Gallery setting for configurable product
Browse files Browse the repository at this point in the history
- Static test improvment
  • Loading branch information
uharbachou1 committed Dec 21, 2015
1 parent 060ed3d commit e8b7b00
Showing 1 changed file with 4 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -912,7 +912,8 @@ define([
var justAnImage = images[0],
updateImg,
imagesToUpdate,
gallery = context.find(this.options.mediaGallerySelector).data('gallery');
gallery = context.find(this.options.mediaGallerySelector).data('gallery'),
item;

if (images) {
imagesToUpdate = this._setImageType($.extend(true, [], images));
Expand All @@ -924,11 +925,8 @@ define([
return img.isMain;
});

if (updateImg.length) {
gallery.updateDataByIndex(0, updateImg[0]);
} else {
gallery.updateDataByIndex(0, imagesToUpdate[0]);
}
item = updateImg.length ? updateImg[0]: imagesToUpdate[0];
gallery.updateDataByIndex(0, item);

gallery.seek(1);
} else {
Expand Down

0 comments on commit e8b7b00

Please sign in to comment.