2012-11-28 14:51:38 -08:00
|
|
|
/**
|
|
|
|
* Theme Customizer enhancements for a better user experience.
|
|
|
|
*
|
|
|
|
* Contains handlers to make Theme Customizer preview reload changes asynchronously.
|
|
|
|
*/
|
|
|
|
|
|
|
|
( function( $ ) {
|
2013-08-17 08:04:32 +09:00
|
|
|
"use strict";
|
|
|
|
|
2012-11-28 14:51:38 -08:00
|
|
|
// Site title and description.
|
|
|
|
wp.customize( 'blogname', function( value ) {
|
|
|
|
value.bind( function( to ) {
|
2013-08-07 18:43:53 +09:00
|
|
|
$( '#masthead a.brand' ).text( to );
|
2013-03-04 16:13:56 -08:00
|
|
|
} );
|
|
|
|
} );
|
2013-08-17 08:04:32 +09:00
|
|
|
|
|
|
|
wp.customize( 'wp386_options[color_combination]', function ( value ) {
|
|
|
|
value.bind( function( to ) {
|
|
|
|
var classes, $el;
|
|
|
|
$el = $('body');
|
|
|
|
classes = $el.attr("class").split(" ").filter(function(item) {
|
|
|
|
return item.indexOf("theme-") === -1 ? item : "";
|
|
|
|
});
|
|
|
|
classes.push('theme-' + to);
|
|
|
|
$el.attr("class", classes.join(" "));
|
|
|
|
} );
|
|
|
|
} );
|
|
|
|
|
2013-07-14 16:38:08 +10:00
|
|
|
} )( jQuery );
|