2012-11-28 22:51:38 +00:00
|
|
|
/**
|
2015-07-01 15:21:44 +00:00
|
|
|
* customizer.js
|
|
|
|
*
|
2012-11-28 22:51:38 +00:00
|
|
|
* Theme Customizer enhancements for a better user experience.
|
|
|
|
*
|
|
|
|
* Contains handlers to make Theme Customizer preview reload changes asynchronously.
|
|
|
|
*/
|
|
|
|
|
|
|
|
( function( $ ) {
|
|
|
|
// Site title and description.
|
|
|
|
wp.customize( 'blogname', function( value ) {
|
|
|
|
value.bind( function( to ) {
|
2013-05-08 11:27:48 +00:00
|
|
|
$( '.site-title a' ).text( to );
|
2012-11-28 22:51:38 +00:00
|
|
|
} );
|
|
|
|
} );
|
|
|
|
wp.customize( 'blogdescription', function( value ) {
|
|
|
|
value.bind( function( to ) {
|
2013-02-07 18:50:34 +00:00
|
|
|
$( '.site-description' ).text( to );
|
2012-11-28 22:51:38 +00:00
|
|
|
} );
|
|
|
|
} );
|
2013-03-05 00:13:56 +00:00
|
|
|
// Header text color.
|
|
|
|
wp.customize( 'header_textcolor', function( value ) {
|
|
|
|
value.bind( function( to ) {
|
2013-07-14 06:38:08 +00:00
|
|
|
if ( 'blank' === to ) {
|
2015-01-09 08:09:22 +00:00
|
|
|
$( '.site-title a, .site-description' ).css( {
|
2013-04-22 15:47:14 +00:00
|
|
|
'clip': 'rect(1px, 1px, 1px, 1px)',
|
|
|
|
'position': 'absolute'
|
|
|
|
} );
|
|
|
|
} else {
|
2015-01-09 08:09:22 +00:00
|
|
|
$( '.site-title a, .site-description' ).css( {
|
2013-04-22 15:47:14 +00:00
|
|
|
'clip': 'auto',
|
|
|
|
'color': to,
|
|
|
|
'position': 'relative'
|
|
|
|
} );
|
|
|
|
}
|
2013-03-05 00:13:56 +00:00
|
|
|
} );
|
|
|
|
} );
|
2013-07-14 06:38:08 +00:00
|
|
|
} )( jQuery );
|