From 6c1787c9c2cf832dbdfe1318e37c2e5941d6d191 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benjamin=20Melan=C3=A7on?= Date: Sat, 31 Aug 2019 09:34:27 -0400 Subject: [PATCH] Commit compiled JS --- .../geofresco/dist/js/responsive-iframes.js | 41 ++++++++++--------- 1 file changed, 22 insertions(+), 19 deletions(-) diff --git a/web/themes/custom/geofresco/dist/js/responsive-iframes.js b/web/themes/custom/geofresco/dist/js/responsive-iframes.js index 7b27b84..6c5b5fb 100644 --- a/web/themes/custom/geofresco/dist/js/responsive-iframes.js +++ b/web/themes/custom/geofresco/dist/js/responsive-iframes.js @@ -7,26 +7,29 @@ (function ($) { 'use strict'; -// Find all iframes -var $iframes = $( "iframe" ); + // Find all iframes + var $iframes = $( "iframe" ); -// Find and save the aspect ratio for all iframes -$iframes.each(function () { - $( this ).data( "ratio", this.height / this.width ) - // Remove the hardcoded width & height attributes - .removeAttr( "width" ) - .removeAttr( "height" ); -}); - -// Resize the iframes when the window is resized -$( window ).resize( function () { - $iframes.each( function() { - // Get the parent container's width - var width = $( this ).parent().width(); - $( this ).width( width ) - .height( width * $( this ).data( "ratio" ) ); + // Find and save the aspect ratio for all iframes + $iframes.each(function () { + $( this ).data( "ratio", this.height / this.width ) + // Remove the hardcoded width & height attributes + .removeAttr( "width" ) + .removeAttr( "height" ); }); -// Resize to fix all iframes on page load. -}).resize(); + + // Resize the iframes when the window is resized + $( window ).resize( function () { + $iframes.each( function() { + // Get the parent container's width + var width = $( this ).parent().width(); + $( this ).width( width ) + .height( width * $( this ).data( "ratio" ) ); + }); + // Resize to fix all iframes on page load. + }).resize(); })(jQuery); + +// Note that we know we have JQuery because our geofresco/global relies on bulma/global +// which pulls in JQuery already.