angelovcom.net

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs

customize-controls.js (710B)


      1 /**
      2  * File customize-controls.js.
      3  *
      4  * Theme Customizer enhancements for a better user experience.
      5  *
      6  * Contains handlers to make Theme Customizer preview reload changes asynchronously.
      7  */
      8 
      9 (function() {
     10 
     11 	wp.customize.bind( 'ready', function() {
     12 
     13 		// Only show the color hue control when there's a custom primary color.
     14 		wp.customize( 'primary_color', function( setting ) {
     15 			wp.customize.control( 'primary_color_hue', function( control ) {
     16 				var visibility = function() {
     17 					if ( 'custom' === setting.get() ) {
     18 						control.container.slideDown( 180 );
     19 					} else {
     20 						control.container.slideUp( 180 );
     21 					}
     22 				};
     23 
     24 				visibility();
     25 				setting.bind( visibility );
     26 			});
     27 		});
     28 	});
     29 
     30 })();