CoreFiles by mySites.guru
theme-customizer.js32 lines, 1,002 bytes, from wordpress-3.5.2.zip
Raw History Compare with 3.5.1
md5
c9ac1b32b2fc8aa30791821641bd8116
sha1
c1e2154f3076d9d82727573e0890511b550b13b0
sha256
93dd2a6fa7aada82b6e07b1ec9b44cc452bf9d6b1da3df9571cfd39dcd7ae1f6
/**
 * 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' ).html( to );
		} );
	} );
	wp.customize( 'blogdescription', function( value ) {
		value.bind( function( to ) {
			$( '.site-description' ).html( 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 );

The same content is in 9 releases, WordPress 3.5-beta2 to 3.5.2. See them all, or every version of this file.