Skip to content

Commit

Permalink
Fix video fluent resizer when wrapping videos (#701)
Browse files Browse the repository at this point in the history
  • Loading branch information
Carlos Gutiérrez authored Jun 26, 2020
1 parent 69ae464 commit 0c574aa
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 8 deletions.
4 changes: 1 addition & 3 deletions assets/src/scripts/routes/single.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,6 @@ export default {
// Set fluid width for mobile videos
( function () {
let $allVideos = $( 'iframe[src*=\'//player.vimeo.com\'], iframe[src*=\'//www.youtube.com\']' );
let $fluidEl = $( '#content' );

$allVideos.each( function () {
$( this )
Expand All @@ -126,10 +125,9 @@ export default {
} );

$( window ).resize( function () {
let newWidth = $fluidEl.width();

$allVideos.each( function () {
let $el = $( this );
let newWidth = $el.parent().parent().width();
$el
.width( newWidth )
.height( newWidth * $el.data( 'aspectRatio' ) );
Expand Down
4 changes: 2 additions & 2 deletions dist/mix-manifest.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"/scripts/book.js": "/scripts/book.js?id=9c333e86a80da58d2793",
"/styles/book.css": "/styles/book.css?id=1321d105150344b5cfab",
"/scripts/book.js": "/scripts/book.js?id=ab7284e0a11a0b5a46fb",
"/styles/book.css": "/styles/book.css?id=81136ff18433f8e3194e",
"/styles/web-house-style.css": "/styles/web-house-style.css?id=d3c1aedc7525b0f30ccd",
"/scripts/collapse-sections.js": "/scripts/collapse-sections.js?id=fed1957a6156e079cddf",
"/scripts/lightbox.js": "/scripts/lightbox.js?id=f3698731576f981b3aa8",
Expand Down
Loading

0 comments on commit 0c574aa

Please sign in to comment.