Skip to content

Commit 0cbff08

Browse files
author
Volodymyr Zaets
committed
MAGETWO-45064: Video preview is visible under video player
1 parent 0b21f1e commit 0cbff08

File tree

1 file changed

+13
-6
lines changed

1 file changed

+13
-6
lines changed

app/code/Magento/ProductVideo/view/frontend/web/js/fotorama-add-video-events.js

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -363,7 +363,9 @@ define([
363363
thumbsParent,
364364
thumbs,
365365
t,
366-
tmpVideoData;
366+
tmpVideoData,
367+
currentItem,
368+
iconClass = 'video-thumb-icon';
367369

368370
if (!fotorama.activeFrame.$navThumbFrame) {
369371
$(this.element).on('fotorama:showend', $.proxy(function (evt, fotoramaData) {
@@ -375,14 +377,19 @@ define([
375377
return null;
376378
}
377379

378-
thumbsParent = fotorama.activeFrame.$navThumbFrame.parent(),
379-
thumbs = thumbsParent.find('.fotorama__nav__frame');
380+
thumbsParent = fotorama.activeFrame.$navThumbFrame.parent();
381+
thumbs = thumbsParent.find('.fotorama__nav__frame:visible');
380382

381383
for (t = 0; t < thumbs.length; t++) {
382384
tmpVideoData = this.options.VideoData[t];
385+
currentItem = thumbs.eq(t);
386+
387+
if (fotorama.options.nav === 'dots' && currentItem.hasClass(iconClass)) {
388+
currentItem.removeCLass(iconClass)
389+
}
383390

384-
if (tmpVideoData.mediaType === this.VID) {
385-
thumbsParent.find('.fotorama__nav__frame:eq(' + t + ')').addClass('video-thumb-icon');
391+
if (tmpVideoData.mediaType === this.VID && fotorama.options.nav === 'thumbs') {
392+
currentItem.addClass(iconClass);
386393
}
387394
}
388395
$(this.element).on('fotorama:showend', $.proxy(function (evt, fotoramaData) {
@@ -594,7 +601,7 @@ define([
594601
iframeElement = $(this).find('iframe'),
595602
currentIndex,
596603
itemIndex,
597-
videoPreview = $item.find('img');
604+
videoPreview = $item.find('img').not('.fotorama__img--full');
598605

599606
if (iframeElement.length === 0) {
600607
return;

0 commit comments

Comments
 (0)