Twenty Thirteen: Fix selective refresh of Masonry-laid out widgets by deferring initialization until DOM ready.
This ensures that the `wp.customize.selectiveRefresh` object will be available when in the Customizer preview. Fixes #37390. Props westonruter, celloexpressions. git-svn-id: https://develop.svn.wordpress.org/trunk@38083 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
b87911eccb
commit
57fe32e081
|
@ -173,7 +173,7 @@ function twentythirteen_scripts_styles() {
|
||||||
wp_enqueue_script( 'jquery-masonry' );
|
wp_enqueue_script( 'jquery-masonry' );
|
||||||
|
|
||||||
// Loads JavaScript file with functionality specific to Twenty Thirteen.
|
// Loads JavaScript file with functionality specific to Twenty Thirteen.
|
||||||
wp_enqueue_script( 'twentythirteen-script', get_template_directory_uri() . '/js/functions.js', array( 'jquery' ), '20150330', true );
|
wp_enqueue_script( 'twentythirteen-script', get_template_directory_uri() . '/js/functions.js', array( 'jquery' ), '20160717', true );
|
||||||
|
|
||||||
// Add Source Sans Pro and Bitter fonts, used in the main stylesheet.
|
// Add Source Sans Pro and Bitter fonts, used in the main stylesheet.
|
||||||
wp_enqueue_style( 'twentythirteen-fonts', twentythirteen_fonts_url(), array(), null );
|
wp_enqueue_style( 'twentythirteen-fonts', twentythirteen_fonts_url(), array(), null );
|
||||||
|
|
|
@ -119,9 +119,13 @@
|
||||||
/**
|
/**
|
||||||
* Arranges footer widgets vertically.
|
* Arranges footer widgets vertically.
|
||||||
*/
|
*/
|
||||||
if ( $.isFunction( $.fn.masonry ) ) {
|
$( function() {
|
||||||
var columnWidth = body.is( '.sidebar' ) ? 228 : 245,
|
var columnWidth, widgetArea;
|
||||||
widgetArea = $( '#secondary .widget-area' );
|
if ( ! $.isFunction( $.fn.masonry ) ) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
columnWidth = body.is( '.sidebar' ) ? 228 : 245;
|
||||||
|
widgetArea = $( '#secondary .widget-area' );
|
||||||
|
|
||||||
widgetArea.masonry( {
|
widgetArea.masonry( {
|
||||||
itemSelector: '.widget',
|
itemSelector: '.widget',
|
||||||
|
@ -157,5 +161,5 @@
|
||||||
}
|
}
|
||||||
} );
|
} );
|
||||||
}
|
}
|
||||||
}
|
} );
|
||||||
} )( jQuery );
|
} )( jQuery );
|
Loading…
Reference in New Issue