Server IP : 170.150.155.74 / Your IP : 13.59.35.247 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 : |
/** * Customizer order control. * * @package Neve\Customizer\Controls */ ( function ( $ ) { 'use strict'; wp.neveOrderControl = { init: function () { this.setupSorting(); this.handleHide(); }, setupSorting: function () { var self = this; $( '.ti-order-sortable' ).each( function () { $( this ).sortable( { revert: true, axis: 'y', containment: 'parent', update: function () { self.updateOrder( this ); }, } ); } ); }, updateOrder: function ( control ) { var value = []; var items = $( control ).find( 'li.enabled' ); $( items ).each( function () { value.push( $( this ).data( 'id' ) ); } ); value = value.filter(function( element ) { return element !== undefined; }); $( control ).next().val( JSON.stringify( value ) ); $( control ).next().trigger( 'change' ); }, handleHide: function () { var self = this; $( '.toggle-display' ).on( 'click touchstart', function () { $( this ).parent().toggleClass( 'enabled' ); self.updateOrder( $( this ).closest( '.ti-order-sortable' ) ); } ); } }; $( document ).ready( function () { wp.neveOrderControl.init(); } ); } )( jQuery );