Twenty Thirteen: instantly preview header text color changes in the Theme Customizer. Fixes #23585, props SriniG.

git-svn-id: http://core.svn.wordpress.org/trunk@23493 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Lance Willett 2013-02-26 04:59:35 +00:00
parent 4ba9ccd643
commit 4aec9565df
2 changed files with 11 additions and 4 deletions

View File

@ -552,8 +552,9 @@ add_filter( 'the_content', 'twentythirteen_aside_date', 8 ); // After embeds, be
* @return void
*/
function twentythirteen_customize_register( $wp_customize ) {
$wp_customize->get_setting( 'blogname' )->transport = 'postMessage';
$wp_customize->get_setting( 'blogdescription' )->transport = 'postMessage';
$wp_customize->get_setting( 'blogname' )->transport = 'postMessage';
$wp_customize->get_setting( 'blogdescription' )->transport = 'postMessage';
$wp_customize->get_setting( 'header_textcolor' )->transport = 'postMessage';
}
add_action( 'customize_register', 'twentythirteen_customize_register' );
@ -564,7 +565,7 @@ add_action( 'customize_register', 'twentythirteen_customize_register' );
* @since Twenty Thirteen 1.0
*/
function twentythirteen_customize_preview_js() {
wp_enqueue_script( 'twentythirteen-customizer', get_template_directory_uri() . '/js/theme-customizer.js', array( 'customize-preview' ), '20130213', true );
wp_enqueue_script( 'twentythirteen-customizer', get_template_directory_uri() . '/js/theme-customizer.js', array( 'customize-preview' ), '20130226', true );
}
add_action( 'customize_preview_init', 'twentythirteen_customize_preview_js' );

View File

@ -17,4 +17,10 @@
$( '.site-description' ).text( to );
} );
} );
} )( jQuery );
// Header text color.
wp.customize( 'header_textcolor', function( value ) {
value.bind( function( to ) {
$( '.site-title, .site-description' ).css( 'color', to );
} );
} );
} )( jQuery );