HEX
Server: LiteSpeed
System: Linux eko108.isimtescil.net 4.18.0-477.21.1.lve.1.el8.x86_64 #1 SMP Tue Sep 5 23:08:35 UTC 2023 x86_64
User: uyarreklamcomtr (11202)
PHP: 7.4.33
Disabled: opcache_get_status
Upload Files
File: /var/www/vhosts/uyarreklam.com.tr/httpdocs/image-grid.js.tar
uyarreklam.com.tr/httpdocs/wp-content/plugins/so-widgets-bundle/widgets/image-grid/js/image-grid.js000064400000002641151547570500032415 0ustar00var/www/vhosts/* globals jQuery, sowb */
var sowb = window.sowb || {};

jQuery( function ( $ ) {
	sowb.setupImageGrids = function () {
		$( '.sow-image-grid-wrapper' ).each( function () {
			var $$ = $( this );
			$$.imagesLoaded( function () {
				var maxWidth = $$.data( 'max-width' ),
					maxHeight = $$.data( 'max-height' );
				
				if ( maxWidth !== undefined || maxHeight !== undefined ) {
					$$.find( 'img' ).each( function () {
						var $img = $( this ).css( 'opacity', 1 );
						var ratio = $img.width() / $img.height();
						
						var width = [];
						
						// Lets set the widths of the image
						if ( maxWidth !== undefined && $img.width() > maxWidth ) {
							width.push( maxWidth );
						}
						
						if ( maxHeight !== undefined && $img.height() > maxHeight ) {
							width.push( Math.round( maxHeight * ratio ) );
						}
						
						if ( width.length ) {
							width = Math.min.apply( Math, width );
							$img.css( 'max-width', width + 'px' );
						}
						
					} );
				}
				else {
					$$.find( 'img' ).css( 'opacity', 1 );
				}
				
				var alignImages = function () {
				};
				alignImages();
				
				$( window ).on( 'resize', alignImages );

				var event = document.createEvent('Event');
				event.initEvent('layoutComplete', true, true);
				$$.get(0).dispatchEvent(event);
			} );
		} );
	};
	sowb.setupImageGrids();
	
	$( sowb ).on( 'setup_widgets', sowb.setupImageGrids );
	
} );

window.sowb = sowb;