wp/wp-content/themes/twentytwelve/js/theme-customizer.js
changeset 5 5e2f62d02dcd
parent 0 d970ebf37754
equal deleted inserted replaced
4:346c88efed21 5:5e2f62d02dcd
     1 /**
     1 /**
     2  * Theme Customizer enhancements for a better user experience.
     2  * Customizer enhancements for a better user experience.
     3  *
     3  *
     4  * Contains handlers to make Theme Customizer preview reload changes asynchronously.
     4  * Contains handlers to make Customizer preview reload changes asynchronously.
     5  * Things like site title, description, and background color changes.
     5  * Things like site title, description, and background color changes.
     6  */
     6  */
     7 
     7 
     8 ( function( $ ) {
     8 ( function( $ ) {
     9 	// Site title and description.
     9 	// Site title and description.
    51 	} );
    51 	} );
    52 	wp.customize( 'background_image', function( value ) {
    52 	wp.customize( 'background_image', function( value ) {
    53 		value.bind( function( to ) {
    53 		value.bind( function( to ) {
    54 			var body = $( 'body' );
    54 			var body = $( 'body' );
    55 
    55 
    56 			if ( '' != to )
    56 			if ( '' !== to ) {
    57 				body.removeClass( 'custom-background-empty custom-background-white' );
    57 				body.removeClass( 'custom-background-empty custom-background-white' );
    58 			else if ( 'rgb(255, 255, 255)' == body.css( 'background-color' ) )
    58 			} else if ( 'rgb(255, 255, 255)' === body.css( 'background-color' ) ) {
    59 				body.addClass( 'custom-background-white' );
    59 				body.addClass( 'custom-background-white' );
    60 			else if ( 'rgb(230, 230, 230)' == body.css( 'background-color' ) && '' == _wpCustomizeSettings.values.background_color )
    60 			} else if ( 'rgb(230, 230, 230)' === body.css( 'background-color' ) && '' === wp.customize.instance( 'background_color' ).get() ) {
    61 				body.addClass( 'custom-background-empty' );
    61 				body.addClass( 'custom-background-empty' );
       
    62 			}
    62 		} );
    63 		} );
    63 	} );
    64 	} );
    64 } )( jQuery );
    65 } )( jQuery );