HEX
Server: LiteSpeed
System: Linux server315.web-hosting.com 4.18.0-553.54.1.lve.el8.x86_64 #1 SMP Wed Jun 4 13:01:13 UTC 2025 x86_64
User: globfdxw (6114)
PHP: 8.1.34
Disabled: NONE
Upload Files
File: //home/globfdxw/www/wp-content/plugins/ubermenu/admin/assets/customizer.js
jQuery( document ).ready( function($){

	//$( '.ubermenu-color-stop' )


	$( '.ubermenu-color-stop' ).each( function(){
//console.log( 'init ' + $(this).attr('class'));


		$(this).wpColorPicker({

			clear: _.throttle( function(){

				//in this function , $(this) is the BUTTON, not the input...
				//console.log( $(this) );
				$(this).prev().find( '.ubermenu-color-stop' ).data( 'um_cleared' , 'cleared' );
				var $control = $(this).closest( '.customize-control-content' );
				update_gradient_list( $control );

			}, 300 ),

			change: _.throttle( function( event , ui ){
				$(this).data( 'um_cleared' , false );
				var $control = $(this).closest( '.customize-control-content' );
				update_gradient_list( $control );
			}, 300 )
		});


		//if( init_color )
	});

	//Run each separately to avoid calling wpColorPicker functions before everything is initialized properly

	$( '.ubermenu-color-stop' ).each( function(){
		var init_color = $(this).data('uber-gradient-color');
		$(this).wpColorPicker( 'color' , init_color );
	});

	function update_gradient_list( $control ){
		var colors = '';
		$control.find( '.ubermenu-color-stop' ).each( function(){
			if( $(this).data( 'um_cleared' ) != 'cleared' ){
				var color = $( this ).wpColorPicker( 'color' );
				if( color ){
					if( colors.length > 0 ) colors += ',';
					colors += color;
				}
			}
		});
		//console.log( 'colors = ' + colors );
		$control.find( '.ubermenu-gradient-list' )
			.val( colors )
			.trigger( 'change' );
	}

});