From 9d4123cee1867ee7199b06bdc92d40611f547ecc Mon Sep 17 00:00:00 2001 From: Zach van Rijn Date: Wed, 21 Jul 2021 14:54:07 -0500 Subject: Initial unmodified import from Astra (Version: 3.6.5) @ /wp-content/themes/astra/. --- assets/js/unminified/customizer-controls.js | 96 +++++++++++++++++++++++++++++ 1 file changed, 96 insertions(+) create mode 100644 assets/js/unminified/customizer-controls.js (limited to 'assets/js/unminified/customizer-controls.js') diff --git a/assets/js/unminified/customizer-controls.js b/assets/js/unminified/customizer-controls.js new file mode 100644 index 0000000..f074bb5 --- /dev/null +++ b/assets/js/unminified/customizer-controls.js @@ -0,0 +1,96 @@ +/** + * Customizer controls + * + * @package Astra + */ + +( function( $ ) { + + /* Internal shorthand */ + var api = wp.customize; + + /** + * Helper class for the main Customizer interface. + * + * @since 1.0.0 + * @class ASTCustomizer + */ + ASTCustomizer = { + + controls : {}, + + /** + * Initializes our custom logic for the Customizer. + * + * @since 1.0.0 + * @method init + */ + init: function() + { + ASTCustomizer._initToggles(); + }, + + /** + * Initializes the logic for showing and hiding controls + * when a setting changes. + * + * @since 1.0.0 + * @access private + * @method _initToggles + */ + _initToggles: function() + { + + // Trigger the Adv Tab Click trigger. + ASTControlTrigger.triggerHook( 'astra-toggle-control', api ); + + // Loop through each setting. + $.each( ASTCustomizerToggles, function( settingId, toggles ) { + + // Get the setting object. + api( settingId, function( setting ) { + + // Loop though the toggles for the setting. + $.each( toggles, function( i, toggle ) { + + // Loop through the controls for the toggle. + $.each( toggle.controls, function( k, controlId ) { + + // Get the control object. + api.control( controlId, function( control ) { + + // Define the visibility callback. + var visibility = function( to ) { + control.container.toggle( toggle.callback( to ) ); + }; + + // Init visibility. + visibility( setting.get() ); + + // Bind the visibility callback to the setting. + setting.bind( visibility ); + }); + }); + }); + }); + + }); + } + }; + + $( function() { ASTCustomizer.init(); } ); + +})( jQuery ); + + +( function( api ) { + // Extends our custom astra-pro section. + api.sectionConstructor['astra-pro'] = api.Section.extend( { + // No events for this type of section. + attachEvents: function () {}, + // Always make the section active. + isContextuallyActive: function () { + return true; + } + } ); +} )( wp.customize ); \ No newline at end of file -- cgit v1.2.3-60-g2f50