Make WordPress Core

Changeset 27627


Ignore:
Timestamp:
03/19/2014 11:07:24 PM (11 years ago)
Author:
lancewillett
Message:

Twenty Fourteen: load Masonry after window load event to give more time for widget content to load before drawing the layout. Closes #27051.

Location:
trunk/src/wp-content/themes/twentyfourteen
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-content/themes/twentyfourteen/functions.php

    r27624 r27627  
    257257    }
    258258
    259     wp_enqueue_script( 'twentyfourteen-script', get_template_directory_uri() . '/js/functions.js', array( 'jquery' ), '20131209', true );
     259    wp_enqueue_script( 'twentyfourteen-script', get_template_directory_uri() . '/js/functions.js', array( 'jquery' ), '20140319', true );
    260260}
    261261add_action( 'wp_enqueue_scripts', 'twentyfourteen_scripts' );
  • trunk/src/wp-content/themes/twentyfourteen/js/functions.js

    r26843 r27627  
    104104    } );
    105105
    106     // Arrange footer widgets vertically.
    107     if ( $.isFunction( $.fn.masonry ) ) {
    108         $( '#footer-sidebar' ).masonry( {
    109             itemSelector: '.widget',
    110             columnWidth: function( containerWidth ) {
    111                 return containerWidth / 4;
    112             },
    113             gutterWidth: 0,
    114             isResizable: true,
    115             isRTL: $( 'body' ).is( '.rtl' )
    116         } );
    117     }
     106    _window.load( function() {
     107        // Arrange footer widgets vertically.
     108        if ( $.isFunction( $.fn.masonry ) ) {
     109            $( '#footer-sidebar' ).masonry( {
     110                itemSelector: '.widget',
     111                columnWidth: function( containerWidth ) {
     112                    return containerWidth / 4;
     113                },
     114                gutterWidth: 0,
     115                isResizable: true,
     116                isRTL: $( 'body' ).is( '.rtl' )
     117            } );
     118        }
    118119
    119     // Initialize Featured Content slider.
    120     _window.load( function() {
     120        // Initialize Featured Content slider.
    121121        if ( body.is( '.slider' ) ) {
    122122            $( '.featured-content' ).featuredslider( {
Note: See TracChangeset for help on using the changeset viewer.