wp386/js/customizer.js
2013-08-17 08:09:59 +09:00

30 lines
760 B
JavaScript

/**
* Theme Customizer enhancements for a better user experience.
*
* Contains handlers to make Theme Customizer preview reload changes asynchronously.
*/
( function( $ ) {
"use strict";
// Site title and description.
wp.customize( 'blogname', function( value ) {
value.bind( function( to ) {
$( '#masthead a.brand' ).text( to );
} );
} );
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(" "));
} );
} );
} )( jQuery );