From f2233c67bb93f09a23b6292fe59de82078366939 Mon Sep 17 00:00:00 2001 From: Lance Willett Date: Wed, 19 Mar 2014 23:07:24 +0000 Subject: [PATCH] Twenty Fourteen: load Masonry after window load event to give more time for widget content to load before drawing the layout. Closes #27051. git-svn-id: https://develop.svn.wordpress.org/trunk@27627 602fd350-edb4-49c9-b593-d223f7449a82 --- .../themes/twentyfourteen/functions.php | 2 +- .../themes/twentyfourteen/js/functions.js | 28 +++++++++---------- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/src/wp-content/themes/twentyfourteen/functions.php b/src/wp-content/themes/twentyfourteen/functions.php index c81df1ff3d..d7c9b19fbe 100644 --- a/src/wp-content/themes/twentyfourteen/functions.php +++ b/src/wp-content/themes/twentyfourteen/functions.php @@ -256,7 +256,7 @@ function twentyfourteen_scripts() { ) ); } - wp_enqueue_script( 'twentyfourteen-script', get_template_directory_uri() . '/js/functions.js', array( 'jquery' ), '20131209', true ); + wp_enqueue_script( 'twentyfourteen-script', get_template_directory_uri() . '/js/functions.js', array( 'jquery' ), '20140319', true ); } add_action( 'wp_enqueue_scripts', 'twentyfourteen_scripts' ); diff --git a/src/wp-content/themes/twentyfourteen/js/functions.js b/src/wp-content/themes/twentyfourteen/js/functions.js index add41087b2..ea656d8077 100644 --- a/src/wp-content/themes/twentyfourteen/js/functions.js +++ b/src/wp-content/themes/twentyfourteen/js/functions.js @@ -103,21 +103,21 @@ } ); } ); - // Arrange footer widgets vertically. - if ( $.isFunction( $.fn.masonry ) ) { - $( '#footer-sidebar' ).masonry( { - itemSelector: '.widget', - columnWidth: function( containerWidth ) { - return containerWidth / 4; - }, - gutterWidth: 0, - isResizable: true, - isRTL: $( 'body' ).is( '.rtl' ) - } ); - } - - // Initialize Featured Content slider. _window.load( function() { + // Arrange footer widgets vertically. + if ( $.isFunction( $.fn.masonry ) ) { + $( '#footer-sidebar' ).masonry( { + itemSelector: '.widget', + columnWidth: function( containerWidth ) { + return containerWidth / 4; + }, + gutterWidth: 0, + isResizable: true, + isRTL: $( 'body' ).is( '.rtl' ) + } ); + } + + // Initialize Featured Content slider. if ( body.is( '.slider' ) ) { $( '.featured-content' ).featuredslider( { selector: '.featured-content-inner > article',