themes-wordpress/dara/assets/js/video-widget.js
Chris Runnells 5f56076846 Dara: Fix related to #108
Found a couple of instances of (window).load() that weren't working with ads, so replaced with (document).ready()
2018-05-22 10:21:57 -10:00

18 lines
486 B
JavaScript

/*
* Triggers resize event to make sure video widgets in the footer maintain the correct aspect ratio
*/
( function( $ ) {
$( document ).on( 'ready', function() {
setTimeout( function(){
if ( typeof( Event ) === 'function' ) {
window.dispatchEvent( new Event( 'resize' ) );
} else {
var event = window.document.createEvent( 'UIEvents' );
event.initUIEvent( 'resize', true, false, window, 0 );
window.dispatchEvent( event );
}
} );
} );
} )( jQuery );