Server IP : 170.150.155.74 / Your IP : 3.139.72.173 Web Server : Apache/2.4.53 (Debian) System : Linux b22bf132354b 5.4.0-162-generic #179-Ubuntu SMP Mon Aug 14 08:51:31 UTC 2023 x86_64 User : www-data ( 33) PHP Version : 7.4.29 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : OFF | Perl : ON | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /var/www/html/wp-content/themes/neve/assets/customizer/js/ |
Upload File : |
/** * File responsive.js * * Handles the responsive * * @package Neve */ wp.customize.controlConstructor[ 'responsive-number' ] = wp.customize.Control.extend( { // When we're finished loading continue processing. ready: function () { 'use strict'; var control = this; /** * Save on change / keyup / paste */ this.container.on( 'change keyup paste input', 'input.responsive-number--input, select.responsive-number--select', function () { control.updateValue(); } ); this.container.on( 'click touchstart', '.reset-number-input', function () { control.resetValues(); } ); }, /** * Reset */ resetValues: function () { 'use strict'; this.container.find( '.responsive-number--input' ).each( function () { jQuery( this ).val( jQuery( this ).data( 'default' ) ); } ); this.container.find( '.responsive-number--select' ).each( function () { jQuery( this ).find( 'option' ).removeAttr( 'selected' ); jQuery( this ).find( 'option[value=' + jQuery( this ).data( 'default' ) + ']' ).attr( 'selected', 'selected' ); } ); this.updateValue(); }, /** * Update */ updateValue: function () { 'use strict'; var control = this, newValue = { suffix: {} }; // Set the spacing container. control.container.find( '.control-wrap' ).each( function () { var controlValue = jQuery( this ).find( 'input' ).val(); var controlUnit = jQuery( this ).find( 'select' ).val(); var query = jQuery( this ).find( 'input' ).data( 'query' ); newValue[ query ] = controlValue; if ( typeof controlUnit !== 'undefined' ) { newValue.suffix[ query ] = controlUnit; } } ); var collector = jQuery( control ).find( '.responsive-number-collector' ); collector.val( JSON.stringify( newValue ) ); control.setting.set( JSON.stringify( newValue ) ); }, } );