diff options
Diffstat (limited to 'plugins/jetpack/modules/theme-tools/responsive-videos/responsive-videos.js')
-rw-r--r-- | plugins/jetpack/modules/theme-tools/responsive-videos/responsive-videos.js | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/plugins/jetpack/modules/theme-tools/responsive-videos/responsive-videos.js b/plugins/jetpack/modules/theme-tools/responsive-videos/responsive-videos.js index 668cc7a0..ab8cbd77 100644 --- a/plugins/jetpack/modules/theme-tools/responsive-videos/responsive-videos.js +++ b/plugins/jetpack/modules/theme-tools/responsive-videos/responsive-videos.js @@ -1,20 +1,17 @@ -( function( $ ) { +( function ( $ ) { var resizeTimer; function responsiveVideos() { $( '.jetpack-video-wrapper' ) .find( 'embed, iframe, object' ) - .each( function() { + .each( function () { var _this, videoWidth, videoHeight, videoRatio, videoWrapper, videoMargin, containerWidth; _this = $( this ); videoMargin = 0; if ( - _this - .parents( '.jetpack-video-wrapper' ) - .prev( 'p' ) - .css( 'text-align' ) === 'center' + _this.parents( '.jetpack-video-wrapper' ).prev( 'p' ).css( 'text-align' ) === 'center' ) { videoMargin = '0 auto'; } @@ -50,10 +47,10 @@ } ); } - $( document ).ready( function() { + $( document ).ready( function () { $( window ) .on( 'load.jetpack', responsiveVideos ) - .on( 'resize.jetpack', function() { + .on( 'resize.jetpack', function () { clearTimeout( resizeTimer ); resizeTimer = setTimeout( responsiveVideos, 500 ); } ) |