mirror of
https://github.com/WordPress/WordPress.git
synced 2024-08-26 07:43:04 +02:00
* 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: http://core.svn.wordpress.org/trunk@21639 1a063a9b-81f0-0310-95a4-ce76da25c4cd
34 lines
1.1 KiB
JavaScript
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 ); |