Current path: home/webdevt/www/demo2/wp-content/themes/spacious/inc/customizer/core/custom-controls/toggle/
?? Go up: /home/webdevt/www/demo2/wp-content/themes/spacious/inc/customizer/core/custom-controls
/**
* Switch toggle control JS to handle the toggle of custom customize controls.
*
* File `toggle.js`.
*
* @package Spacious
*/
wp.customize.controlConstructor['spacious-toggle'] = wp.customize.Control.extend( {
ready : function () {
'use strict';
var control = this,
value = control.setting._value;
// Save the value.
this.container.on( 'change', 'input', function () {
value = jQuery( this ).is( ':checked' ) ? true : false;
control.setting.set( value );
} );
}
} );