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/accordion.js
( function( $ ) {
	var WidgetoewAccordionHandler = function( $scope, $ ) {

		var $accordion 	= $scope.find( '.oew-accordion' ),
			$data 		= $accordion.data( 'settings' );

		if ( $accordion.hasClass( 'oew-has-active-item' ) ) {
			$accordion.find( '.oew-accordion-item:nth-child('+ $data['active_item'] +')' ).addClass( 'oew-active' ).find( '.oew-accordion-content' ).slideDown( 200 );
		}

	    $accordion.find( '.oew-accordion-title' ).on( 'click', function() {
			var $this 	= $( this ),
				$parent =  $this.parent(),
				$next 	=  $this.next();
			
		    if ( 'true' == $data['multiple'] ) {
		    	$parent.toggleClass( 'oew-active' ).find( '.oew-accordion-content' ).slideToggle( 200 );
			} else {
		    	if ( $parent.hasClass( 'oew-active' ) ) {
		    		$parent.removeClass( 'oew-active' )
		    		$next.slideUp( 200 );
		    	} else {
			        $parent.parent().find( '.oew-accordion-item' ).removeClass( 'oew-active' );
			        $parent.parent().find( '.oew-accordion-content' ).slideUp( 200 );

		    		$parent.toggleClass( 'oew-active' );
		    		$next.slideToggle( 200 );
		    	}
			}

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