0
|
1 |
/** |
5
|
2 |
* Customizer enhancements for a better user experience. |
0
|
3 |
* |
5
|
4 |
* Contains handlers to make Customizer preview reload changes asynchronously. |
0
|
5 |
* Things like site title and description changes. |
|
6 |
*/ |
|
7 |
|
|
8 |
( function( $ ) { |
|
9 |
// Site title and description. |
|
10 |
wp.customize( 'blogname', function( value ) { |
|
11 |
value.bind( function( to ) { |
|
12 |
$( '.site-title' ).text( to ); |
|
13 |
} ); |
|
14 |
} ); |
|
15 |
wp.customize( 'blogdescription', function( value ) { |
|
16 |
value.bind( function( to ) { |
|
17 |
$( '.site-description' ).text( to ); |
|
18 |
} ); |
|
19 |
} ); |
|
20 |
// Header text color. |
|
21 |
wp.customize( 'header_textcolor', function( value ) { |
|
22 |
value.bind( function( to ) { |
|
23 |
if ( 'blank' == to ) { |
5
|
24 |
if ( 'remove-header' == wp.customize.instance( 'header_image' ).get() ) { |
0
|
25 |
$( '.home-link' ).css( 'min-height', '0' ); |
5
|
26 |
} |
0
|
27 |
$( '.site-title, .site-description' ).css( { |
|
28 |
'clip': 'rect(1px, 1px, 1px, 1px)', |
|
29 |
'position': 'absolute' |
|
30 |
} ); |
|
31 |
} else { |
|
32 |
$( '.home-link' ).css( 'min-height', '230px' ); |
|
33 |
$( '.site-title, .site-description' ).css( { |
|
34 |
'clip': 'auto', |
|
35 |
'color': to, |
|
36 |
'position': 'relative' |
|
37 |
} ); |
|
38 |
} |
|
39 |
} ); |
|
40 |
} ); |
|
41 |
} )( jQuery ); |