Skip to content
Snippets Groups Projects
Commit 029619ea authored by Stefan Galinski's avatar Stefan Galinski :video_game:
Browse files

[BUGFIX] Only replace the thumbnail with the youtube video

parent ab9f129f
No related branches found
No related tags found
No related merge requests found
......@@ -51,9 +51,10 @@ module.exports = function() {
$youtubeItem.css('display', 'block');
let queryString = prepareVideoUrl($youtubeItem.attr('href')),
width = $youtubeItem.outerWidth() + 'px',
height = $youtubeItem.outerHeight() + 'px';
$youtubeItem.replaceWith('<div class="sg-youtube-item sg-card-shadow" ' +
$thumbnailElement = $youtubeItem.find('.sg-youtube-image'),
width = $thumbnailElement.outerWidth() + 'px',
height = $thumbnailElement.outerHeight() + 'px';
$thumbnailElement.replaceWith('<div class="sg-youtube-item sg-card-shadow" ' +
'style="height: ' + height + '; width: ' + width + ';"><iframe ' +
'width="' + width + '" height="' + height + '" ' +
'src="https://www.youtube-nocookie.com/embed/' + queryString + '" frameborder="0" ' +
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment