Skip to content

Commit

Permalink
Merge pull request #80 from AnastasiaBuniakEPAM/JS-375
Browse files Browse the repository at this point in the history
Js 375: ProductVideo works incorect when Gallery updates
  • Loading branch information
uharbachou1 committed Jan 25, 2016
2 parents 9277cb9 + 5883b26 commit 249756f
Show file tree
Hide file tree
Showing 9 changed files with 185 additions and 165 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -271,27 +271,28 @@ define([
});

imgToUpdate = mainImg.length ? mainImg[0] : imagesArr[0];

!imgToUpdate.type && (imgToUpdate.type = 'image');

galleryObject.updateDataByIndex(0, imgToUpdate);
galleryObject.seek(1);
}

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

if (this.options.onlyMainImg) {
updateGallery(images);
} else {
images.map(function (img) {
img.type = 'image';
});
galleryObject.updateData(images)
}
} else {
this.options.onlyMainImg ?
updateGallery(initialImages) :
if (this.options.onlyMainImg) {
updateGallery(initialImages);
} else {
galleryObject.updateData(this.options.mediaGalleryInitial);
$(this.options.mediaGallerySelector).AddFotoramaVideoEvents();
}
}
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
{
"[data-gallery-role=gallery-placeholder]": {
"Magento_ProductVideo/js/fotorama-add-video-events": {
"fotoramaVideoData": <?php /* @escapeNotVerified */ echo $block->getMediaGalleryDataJson(); ?>,
"fotoramaVideoSettings": <?php /* @escapeNotVerified */ echo $block->getVideoSettingsJson(); ?>
"videoData": <?php /* @escapeNotVerified */ echo $block->getMediaGalleryDataJson(); ?>,
"videoSettings": <?php /* @escapeNotVerified */ echo $block->getVideoSettingsJson(); ?>
}
}
}
Expand Down
Loading

0 comments on commit 249756f

Please sign in to comment.