2 * Scripts within the customizer controls window.
4 * Contextually shows the color hue control and informs the preview
5 * when users open or close the front page sections section.
9 wp.customize.bind( 'ready', function() {
11 // Only show the color hue control when there's a custom color scheme.
12 wp.customize( 'colorscheme', function( setting ) {
13 wp.customize.control( 'colorscheme_hue', function( control ) {
14 var visibility = function() {
15 if ( 'custom' === setting.get() ) {
16 control.container.slideDown( 180 );
18 control.container.slideUp( 180 );
23 setting.bind( visibility );
27 // Detect when the front page sections section is expanded (or closed) so we can adjust the preview accordingly.
28 wp.customize.section( 'theme_options' ).expanded.bind( function( isExpanding ) {
30 // Value of isExpanding will = true if you're entering the section, false if you're leaving it.
31 wp.customize.previewer.send( 'section-highlight', { expanded: isExpanding });