wp386/js/customizer.js

30 lines
760 B
JavaScript
Raw Permalink Normal View History

/**
* 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";
// 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-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 );