WordPress/wp-content/themes/twentyfifteen/js/customize-preview.js
Ian Stewart 65ed77974b Twenty Fifteen: minor file cleanup.
Props iamtakashi, fixes #30653.


Built from https://develop.svn.wordpress.org/trunk@30806


git-svn-id: http://core.svn.wordpress.org/trunk@30796 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-12-10 13:39:24 +00:00

35 lines
807 B
JavaScript

/**
* Live-update changed settings in real time in the Customizer preview.
*/
( function( $ ) {
var $style = $( '#twentyfifteen-color-scheme-css' );
if ( ! $style.length ) {
$style = $( 'head' ).append( '<style type="text/css" id="twentyfifteen-color-scheme-css" />' )
.find( '#twentyfifteen-color-scheme-css' );
}
// Site title.
wp.customize( 'blogname', function( value ) {
value.bind( function( to ) {
$( '.site-title a' ).text( to );
} );
} );
// Site tagline.
wp.customize( 'blogdescription', function( value ) {
value.bind( function( to ) {
$( '.site-description' ).text( to );
} );
} );
// Color Scheme CSS.
wp.customize( 'color_scheme_css', function( value ) {
value.bind( function( to ) {
$style.html( to );
} );
} );
} )( jQuery );