|
4 | 4 | * Theme Customizer enhancements for a better user experience. |
5 | 5 | * |
6 | 6 | * Contains handlers to make Theme Customizer preview reload changes asynchronously. |
| 7 | + * @param {Object} $ jQuery object. |
7 | 8 | */ |
8 | 9 |
|
9 | | -(($) => { |
| 10 | +( ( $ ) => { |
10 | 11 | // Site title and description. |
11 | | - wp.customize('blogname', (value) => { |
12 | | - value.bind(function (to) { |
13 | | - $('.site-title a').text(to); |
14 | | - }); |
15 | | - }); |
| 12 | + wp.customize( 'blogname', ( value ) => { |
| 13 | + value.bind( function( to ) { |
| 14 | + $( '.site-title a' ).text( to ); |
| 15 | + } ); |
| 16 | + } ); |
16 | 17 |
|
17 | | - wp.customize('blogdescription', (value) => { |
18 | | - value.bind(function (to) { |
19 | | - $('.site-description').text(to); |
20 | | - }); |
21 | | - }); |
| 18 | + wp.customize( 'blogdescription', ( value ) => { |
| 19 | + value.bind( function( to ) { |
| 20 | + $( '.site-description' ).text( to ); |
| 21 | + } ); |
| 22 | + } ); |
22 | 23 |
|
23 | 24 | // Header text color. |
24 | | - wp.customize('header_textcolor', (value) => { |
25 | | - value.bind(function (to) { |
26 | | - if ('blank' === to) { |
27 | | - $('.site-title, .site-description').css({ |
| 25 | + wp.customize( 'header_textcolor', ( value ) => { |
| 26 | + value.bind( function( to ) { |
| 27 | + if ( 'blank' === to ) { |
| 28 | + $( '.site-title, .site-description' ).css( { |
28 | 29 | clip: 'rect(1px, 1px, 1px, 1px)', |
29 | 30 | position: 'absolute', |
30 | | - }); |
| 31 | + } ); |
31 | 32 | } else { |
32 | | - $('.site-title, .site-description').css({ |
| 33 | + $( '.site-title, .site-description' ).css( { |
33 | 34 | clip: 'auto', |
34 | 35 | position: 'relative', |
35 | | - }); |
36 | | - $('.site-title a, .site-description').css({ |
| 36 | + } ); |
| 37 | + $( '.site-title a, .site-description' ).css( { |
37 | 38 | color: to, |
38 | | - }); |
| 39 | + } ); |
39 | 40 | } |
40 | | - }); |
41 | | - }); |
42 | | -} )( jQuery ); // eslint-disable-line -- no-undef |
| 41 | + } ); |
| 42 | + } ); |
| 43 | +} )( jQuery ); // eslint-disable-line no-undef |
0 commit comments