Commit compiled JS

This commit is contained in:
Benjamin Melançon 2019-08-31 09:34:27 -04:00
parent 3f144b8fd5
commit 6c1787c9c2

View file

@ -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.