MOON
Server: Apache
System: Linux server1.studioinfinity.com.br 2.6.32-954.3.5.lve1.4.90.el6.x86_64 #1 SMP Tue Feb 21 12:26:30 UTC 2023 x86_64
User: artinside (517)
PHP: 7.4.33
Disabled: exec,passthru,shell_exec,system
Upload Files
File: /home/artinside/mpita.artinside.com.br/themes/web/assets/js/modules/sliderdimensions.js
CNVS.SliderDimensions = function() {
	var __core = SEMICOLON.Core;
	var __base = SEMICOLON.Base;

	return {
		init: function(selector) {
			selector = __core.getSelector( selector, false );
			if( selector.length < 1 ){
				return true;
			}

			var slider = document.querySelector('.slider-element'),
				sliderParallaxEl = document.querySelector('.slider-parallax'),
				body = __core.getVars.elBody,
				parallaxElHeight = sliderParallaxEl?.offsetHeight,
				parallaxElWidth = sliderParallaxEl?.offsetWidth,
				slInner = sliderParallaxEl?.querySelector('.slider-inner'),
				slSwiperW = slider.querySelector('.swiper-wrapper'),
				slSwiperS = slider.querySelector('.swiper-slide'),
				slFlexHeight = slider.classList.contains('h-auto') || slider.classList.contains('min-vh-0');

			if( body.classList.contains('device-up-lg') ) {
				setTimeout(function() {
					if( slInner ) {
						slInner.style.height = parallaxElHeight + 'px';
					}
					if( slFlexHeight ) {
						parallaxElHeight = slider.querySelector('.slider-inner')?.querySelector('*').offsetHeight;
						slider.style.height = parallaxElHeight + 'px';
						if( slInner ) {
							slInner.style.height = parallaxElHeight + 'px';
						}
					}
				}, 500);

				if( slFlexHeight && slSwiperS ) {
					var slSwiperFC = slSwiperS.querySelector('*');
					if( slSwiperFC.classList.contains('container') || slSwiperFC.classList.contains('container-fluid') ) {
						slSwiperFC = slSwiperFC.querySelector('*');
					}
					if( slSwiperFC.offsetHeight > slSwiperW.offsetHeight ) {
						slSwiperW.style.height = 'auto';
					}
				}

				if( body.classList.contains('side-header') && slInner ) {
					slInner.style.width = parallaxElWidth + 'px';
				}

				if( !body.classList.contains('stretched') ) {
					parallaxElWidth = __core.getVars.elWrapper.offsetWidth;
					if( slInner ) {
						slInner.style.width = parallaxElWidth + 'px';
					}
				}
			} else {
				if( slSwiperW ) {
					slSwiperW.style.height = '';
				}

				if( sliderParallaxEl ) {
					sliderParallaxEl.style.height = '';
				}

				if( slInner ) {
					slInner.style.width = '';
					slInner.style.height = '';
				}
			}

			__core.getVars.resizers.sliderdimensions = function() {
				__base.sliderDimensions();
			};
		}
	};
}();