Server IP : 192.158.238.246 / Your IP : 18.217.170.18 Web Server : LiteSpeed System : Linux uniform.iwebfusion.net 4.18.0-553.27.1.lve.1.el8.x86_64 #1 SMP Wed Nov 20 15:58:00 UTC 2024 x86_64 User : jenniferflocom ( 1321) PHP Version : 8.1.32 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /home/jenniferflocom/www/wp-content/themes/open-shop/customizer/js/ |
Upload File : |
/** * Customizer controls toggles * */ ( function( $ ){ /* Internal shorthand */ var api = wp.customize; /** * Trigger hooks */ OPNControlTrigger = { /** * Trigger a hook. * * @since 1.0.0 * @method triggerHook * @param {String} hook The hook to trigger. * @param {Array} args An array of args to pass to the hook. */ triggerHook: function( hook, args ) { $( 'body' ).trigger( 'open-shop-control-trigger.' + hook, args ); }, /** * Add a hook. * * @since 1.0.0 * @method addHook * @param {String} hook The hook to add. * @param {Function} callback A function to call when the hook is triggered. */ addHook: function( hook, callback ) { $( 'body' ).on( 'open-shop-control-trigger.' + hook, callback ); }, /** * Remove a hook. * * @since 1.0.0 * @method removeHook * @param {String} hook The hook to remove. * @param {Function} callback The callback function to remove. */ removeHook: function( hook, callback ) { $( 'body' ).off( 'open-shop-control-trigger.' + hook, callback ); }, }; OPNCustomizerToggles = { }; } )( jQuery ); /**************************************/ /** * Customizer controls * */ /**************************************/ ( function( $ ){ /* Internal shorthand */ var api = wp.customize; /** * Helper class for the main Customizer interface. * * @since 1.0.0 * @class OPNCustomizer */ OPNCustomizer = { controls : {}, /** * Initializes our custom logic for the Customizer. * * @since 1.0.0 * @method init */ init: function() { OPNCustomizer._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. OPNControlTrigger.triggerHook( 'open-shop-toggle-control', api ); // Loop through each setting. $.each( OPNCustomizerToggles, 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() { OPNCustomizer.init(); } ); })( jQuery );