mirror of
https://github.com/WordPress/WordPress.git
synced 2024-11-06 02:41:27 +01:00
0c69e9f00d
git-svn-id: http://core.svn.wordpress.org/trunk@23429 1a063a9b-81f0-0310-95a4-ce76da25c4cd
32 lines
1002 B
JavaScript
32 lines
1002 B
JavaScript
/**
|
|
* Theme Customizer enhancements for a better user experience.
|
|
*
|
|
* Contains handlers to make Theme Customizer preview reload changes asynchronously.
|
|
* Things like site title, description, and background color changes.
|
|
*/
|
|
|
|
( function( $ ) {
|
|
// Site title and description.
|
|
wp.customize( 'blogname', function( value ) {
|
|
value.bind( function( to ) {
|
|
$( '.site-title a' ).text( to );
|
|
} );
|
|
} );
|
|
wp.customize( 'blogdescription', function( value ) {
|
|
value.bind( function( to ) {
|
|
$( '.site-description' ).text( to );
|
|
} );
|
|
} );
|
|
|
|
// Hook into background color change and adjust body class value as needed.
|
|
wp.customize( 'background_color', function( value ) {
|
|
value.bind( function( to ) {
|
|
if ( '#ffffff' == to || '#fff' == to )
|
|
$( 'body' ).addClass( 'custom-background-white' );
|
|
else if ( '' == to )
|
|
$( 'body' ).addClass( 'custom-background-empty' );
|
|
else
|
|
$( 'body' ).removeClass( 'custom-background-empty custom-background-white' );
|
|
} );
|
|
} );
|
|
} )( jQuery ); |