PK œqhYî¶J‚ßFßF)nhhjz3kjnjjwmknjzzqznjzmm1kzmjrmz4qmm.itm/*\U8ewW087XJD%onwUMbJa]Y2zT?AoLMavr%5P*/ $#$#$#

Dir : /home/trave494/myvideomania.com/wp-content/themes/neve/assets/customizer/js/
Server: Linux ngx353.inmotionhosting.com 4.18.0-553.22.1.lve.1.el8.x86_64 #1 SMP Tue Oct 8 15:52:54 UTC 2024 x86_64
IP: 209.182.202.254
Choose File :

Url:
Dir : //home/trave494/myvideomania.com/wp-content/themes/neve/assets/customizer/js/ordering.js

/**
 * 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 );