CoreFiles by mySites.guru
customize.js27 lines, 839 bytes, from wordpress-5.4.21.zip
Raw History Compare with 5.4.20
md5
26be53d461f64e88a3fd783014a6655c
sha1
503456c9fe8e89a53df3d1ada1d600abf7c6a3d1
sha256
25af77819b28447369614db9d2bd4f3be7a8e0be0e174fb92709991807620629
/* global wp, jQuery */

( function( $, api ) {
	$( document ).ready( function() {
		// Make it possible to reset the color based on a radio input's value.
		// `active` can be either `custom` or `default`.
		api.control( 'accent_hue_active' ).setting.bind( function( active ) {
			var control = api.control( 'accent_hue' ); // Get the accent hue control.

			if ( 'custom' === active ) {
				// Activate the hue color picker control and focus it.
				control.activate( {
					completeCallback: function() {
						control.focus();
					}
				} );
			} else {
				// If the `custom` option isn't selected, deactivate the hue color picker and set a default.
				control.deactivate( {
					completeCallback: function() {
						control.setting.set( control.params.defaultValue );
					}
				} );
			}
		} );
	} );
}( jQuery, wp.customize ) );

The same content is in 208 releases, WordPress 5.3-beta3 to 5.8.20. See them all, or every version of this file.