Wordpress/wp-content/themes/twentytwelve/js/theme-customizer.js
Lance Willett 6165bfd311 Twenty Twelve: simplify custom font loading behavior, see #21694.
* Remove theme options code and support from theme.
 * Keep Open Sans font first in the stack and make it always loaded.
 * Move Customizer pieces from Theme Options out of class structure and into functions.php.


git-svn-id: https://develop.svn.wordpress.org/trunk@21639 602fd350-edb4-49c9-b593-d223f7449a82
2012-08-28 02:18:43 +00:00

34 lines
1.1 KiB
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.
*
* See related settings in twentytwelve_customize_preview_js()
*/
( 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 || '' == to )
$( 'body' ).addClass( 'custom-background-white' );
else if ( '' == to )
$( 'body' ).addClass( 'custom-background-empty' );
else
$( 'body' ).removeClass( 'custom-background-empty custom-background-white' );
} );
} );
} )( jQuery );