HEX
Server: Apache
System: Linux WWW 6.1.0-40-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.153-1 (2025-09-20) x86_64
User: web11 (1011)
PHP: 8.2.29
Disabled: NONE
Upload Files
File: /var/www/ippmt.kauko.lt/wp-content/plugins/ocean-elementor-widgets/assets/js/toggle.js
( function( $ ) {
	var WidgetoewToggleHandler = function( $scope, $ ) {

		var $switch = $scope.find( '.oew-switch-container' ).eq(0),
			$label 	= $switch.find( '.oew-switch-label' );

	    $label.toggle(
            function() {
				$( this ).closest( '.oew-switch-wrap' ).addClass( 'oew-switch-on' );
				$( this ).closest( '.oew-switch-container' ).find( '.oew-switch-secondary-wrap' ).addClass( 'show' );
		    	$( this ).closest( '.oew-switch-container' ).find( '.oew-switch-primary-wrap' ).addClass( 'hide' );
		    	
				oewProductSlider();
            },
            function() {
				$( this ).closest( '.oew-switch-wrap' ).removeClass( 'oew-switch-on' );
				$( this ).closest( '.oew-switch-container' ).find( '.oew-switch-secondary-wrap' ).removeClass( 'show' );
		    	$( this ).closest( '.oew-switch-container' ).find( '.oew-switch-primary-wrap' ).removeClass( 'hide' );
		    	
				oewProductSlider();
            }
        );

		// Re-run function
		var oewProductSlider = function() {
			if ( ! $( 'body' ).hasClass( 'no-carousel' )
				&& $scope.find( '.woo-entry-image.product-entry-slider' ).length) {
                setTimeout( function() {
                    $scope.find( '.woo-entry-image.product-entry-slider' ).slick( 'unslick' );
                    oceanwpInitCarousel();
                }, 200 );
            }
        }

	};
	
	// Make sure we run this code under Elementor
	$( window ).on( 'elementor/frontend/init', function() {
		elementorFrontend.hooks.addAction( 'frontend/element_ready/oew-toggle.default', WidgetoewToggleHandler );
	} );
} )( jQuery );