2020-04-05 20:49:27 +00:00
|
|
|
/* global wp, jQuery */
|
2012-11-28 22:51:38 +00:00
|
|
|
/**
|
2015-12-13 14:03:43 +00:00
|
|
|
* File customizer.js.
|
2015-07-01 15:21:44 +00:00
|
|
|
*
|
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
|
|
|
} );
|
|
|
|
} );
|
2015-12-13 14:03:43 +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 ) {
|
2016-10-16 17:17:47 +00:00
|
|
|
$( '.site-title, .site-description' ).css( {
|
2020-04-05 20:49:27 +00:00
|
|
|
clip: 'rect(1px, 1px, 1px, 1px)',
|
|
|
|
position: 'absolute',
|
2013-04-22 15:47:14 +00:00
|
|
|
} );
|
|
|
|
} else {
|
2016-10-16 17:17:47 +00:00
|
|
|
$( '.site-title, .site-description' ).css( {
|
2020-04-05 20:49:27 +00:00
|
|
|
clip: 'auto',
|
|
|
|
position: 'relative',
|
2013-04-22 15:47:14 +00:00
|
|
|
} );
|
2015-07-27 15:32:21 +00:00
|
|
|
$( '.site-title a, .site-description' ).css( {
|
2020-04-05 20:49:27 +00:00
|
|
|
color: to,
|
2015-07-27 15:32:21 +00:00
|
|
|
} );
|
2013-04-22 15:47:14 +00:00
|
|
|
}
|
2013-03-05 00:13:56 +00:00
|
|
|
} );
|
|
|
|
} );
|
2020-04-05 20:49:27 +00:00
|
|
|
}( jQuery ) );
|