diff --git a/assets/js/main.js b/assets/js/main.js index 2b26d41..81af818 100644 --- a/assets/js/main.js +++ b/assets/js/main.js @@ -1856,7 +1856,7 @@ if (!Date.now) /* ====== ON WINDOW LOAD ====== */ - $window.load(function() { + $window.on('load', function() { browserSize(); navigation.init(); fixedSidebars.update(); @@ -1902,6 +1902,7 @@ if (!Date.now) svgLogo.update(); ticking = false; } + /* ====== HELPER FUNCTIONS ====== */ diff --git a/assets/js/main/main.js b/assets/js/main/main.js index a2730af..73613a3 100644 --- a/assets/js/main/main.js +++ b/assets/js/main/main.js @@ -11,7 +11,7 @@ function init() { /* ====== ON WINDOW LOAD ====== */ -$window.load(function() { +$window.on('load', function() { browserSize(); navigation.init(); fixedSidebars.update(); @@ -56,4 +56,4 @@ function update() { fixedSidebars.update(); svgLogo.update(); ticking = false; -} \ No newline at end of file +} diff --git a/inc/jetpack/responsive-videos/responsive-videos.js b/inc/jetpack/responsive-videos/responsive-videos.js index 7b09922..ec36a6b 100644 --- a/inc/jetpack/responsive-videos/responsive-videos.js +++ b/inc/jetpack/responsive-videos/responsive-videos.js @@ -87,7 +87,7 @@ * Load responsive_videos(). * Trigger resize to make sure responsive_videos() is loaded after IS. */ - $( window ).load( responsive_videos ).resize( debounce( responsive_videos, 100 ) ).trigger( 'resize' ); + $( window ).on('load', responsive_videos ).resize( debounce( responsive_videos, 100 ) ).trigger( 'resize' ); $( document ).on( 'post-load', responsive_videos ); -} )( jQuery ); \ No newline at end of file +} )( jQuery ); diff --git a/inc/jetpack/responsive-videos/responsive-videos.min.js b/inc/jetpack/responsive-videos/responsive-videos.min.js index e6873a3..ac18845 100644 --- a/inc/jetpack/responsive-videos/responsive-videos.min.js +++ b/inc/jetpack/responsive-videos/responsive-videos.min.js @@ -1 +1 @@ -!function(t){function a(){t(".jetpack-video-wrapper").find("embed, iframe, object").each(function(){var a=t(this);a.attr("data-ratio")||a.attr("data-ratio",this.height/this.width).attr("data-width",this.width).attr("data-height",this.height).css({display:"block",margin:0});var i=a.attr("data-width"),e=a.attr("data-height"),r=a.attr("data-ratio"),h=a.parent(),n=h.width();"Infinity"===r&&(i="100%"),a.removeAttr("height").removeAttr("width"),i>n?a.width(n).height(n*r):a.width(i).height(e)})}var i=function(t,a){var i,e,r,h;return function(){r=this,e=[].slice.call(arguments,0),h=new Date;var n=function(){var d=new Date-h;a>d?i=setTimeout(n,a-d):(i=null,t.apply(r,e))};i||(i=setTimeout(n,a))}};t(window).load(a).resize(i(a,100)).trigger("resize"),t(document).on("post-load",a)}(jQuery); \ No newline at end of file +!function(t){function a(){t(".jetpack-video-wrapper").find("embed, iframe, object").each(function(){var a=t(this);a.attr("data-ratio")||a.attr("data-ratio",this.height/this.width).attr("data-width",this.width).attr("data-height",this.height).css({display:"block",margin:0});var i=a.attr("data-width"),e=a.attr("data-height"),r=a.attr("data-ratio"),h=a.parent(),n=h.width();"Infinity"===r&&(i="100%"),a.removeAttr("height").removeAttr("width"),i>n?a.width(n).height(n*r):a.width(i).height(e)})}var i=function(t,a){var i,e,r,h;return function(){r=this,e=[].slice.call(arguments,0),h=new Date;var n=function(){var d=new Date-h;a>d?i=setTimeout(n,a-d):(i=null,t.apply(r,e))};i||(i=setTimeout(n,a))}};t(window).on('load', a).resize(i(a,100)).trigger("resize"),t(document).on("post-load",a)}(jQuery);