~canonical-sysadmins/wordpress/4.7.4

« back to all changes in this revision

Viewing changes to wp-content/themes/twentythirteen/js/theme-customizer.js

  • Committer: Jacek Nykis
  • Date: 2015-01-05 16:17:05 UTC
  • Revision ID: jacek.nykis@canonical.com-20150105161705-w544l1h5mcg7u4w9
Initial commit

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/**
 
2
 * Theme Customizer enhancements for a better user experience.
 
3
 *
 
4
 * Contains handlers to make Theme Customizer preview reload changes asynchronously.
 
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 ) {
 
24
                                if ( 'remove-header' == _wpCustomizeSettings.values.header_image )
 
25
                                        $( '.home-link' ).css( 'min-height', '0' );
 
26
                                $( '.site-title, .site-description' ).css( {
 
27
                                        'clip': 'rect(1px, 1px, 1px, 1px)',
 
28
                                        'position': 'absolute'
 
29
                                } );
 
30
                        } else {
 
31
                                $( '.home-link' ).css( 'min-height', '230px' );
 
32
                                $( '.site-title, .site-description' ).css( {
 
33
                                        'clip': 'auto',
 
34
                                        'color': to,
 
35
                                        'position': 'relative'
 
36
                                } );
 
37
                        }
 
38
                } );
 
39
        } );
 
40
} )( jQuery );