mirror of
https://github.com/WordPress/WordPress.git
synced 2024-08-18 11:42:57 +02:00
This brings `trunk`'s version of Twenty Twenty in-sync with GitHub.
For a complete list of changes since [46357], see 7157870...7246fd6
.
Props anlino, ianbelanger, poena, williampatton, nielslange, acosmin, netweb, joyusly, luminuu, itowhid06, cbravobernal, intimez, glauberglauber, ocean90, amolv, briceduclos, aristath, mukesh27, garrett-eclipse, audrasjb, afercia, dianeco, utsav72640, mahesh901122, tobifjellner.
See #48110.
Built from https://develop.svn.wordpress.org/trunk@46445
git-svn-id: http://core.svn.wordpress.org/trunk@46243 1a063a9b-81f0-0310-95a4-ce76da25c4cd
28 lines
839 B
JavaScript
28 lines
839 B
JavaScript
/* 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 ) );
|