$previewImageUrls = array_slice($allImageUrls, 0, 3);
$previewImageUrls += array_fill(0, 3 - count($previewImageUrls), null);
- $galleryId = 'gallery-' . $model->id;
+ $imageGalleryId = 'gallery-images-' . $model->id;
+ $videoGalleryId = 'gallery-video-' . $model->id;
$hiddenLinks = "";
if (count($allImageUrls) > 3) {
foreach (array_slice($allImageUrls, 3) as $url) {
$hiddenLinks .= Html::a('', $url, [
- 'data-fancybox' => $galleryId,
+ 'data-fancybox' => $imageGalleryId,
'style' => 'display:none;'
]);
}
'style' => 'width: 100%; height: 100%; object-fit: cover;',
]),
$previewImageUrls[0],
- ['data-fancybox' => $galleryId]
+ ['data-fancybox' => $imageGalleryId]
);
}
$html .= "
'javascript:;',
[
'style' => 'width: 100%; height: 100%; display:block;',
- 'data-fancybox' => $galleryId,
+ 'data-fancybox' => $videoGalleryId,
'data-src' => '<video controls style="width:100%; height:auto;">
<source src="' . Url::to($model->presentation->url ?? null) . '" type="video/mp4">
</video>',
'style' => 'width: 100%; height: 100%; object-fit: cover;',
]),
$previewImageUrls[1],
- ['data-fancybox' => $galleryId]
+ ['data-fancybox' => $imageGalleryId]
);
}
$html .= "
'javascript:;',
[
'style' => 'width: 100%; height: 100%; display:block;',
- 'data-fancybox' => $galleryId,
+ 'data-fancybox' => $videoGalleryId,
'data-src' => '<video controls style="width:100%; height:auto;">
<source src="' . Url::to($model->buildProcess->url ?? null) . '" type="video/mp4">
</video>',
'style' => 'width: 100%; height: 100%; object-fit: cover;'
]),
$previewImageUrls[2],
- ['data-fancybox' => $galleryId]
+ ['data-fancybox' => $imageGalleryId]
);
}
$html .= "