PageSourceSearch

https://alfalaboratory.com/wp-content/themes/leblix/js/elementor.js?ver=6a64cf10ea0ba29330f6facccc9292f2

js alfalaboratory.com collected 2026-09-26 08:04:32 UTC 21,296 bytes, 575 lines download raw bytes

1"use strict";
2
3/* ====================================== */
4/* Reset and rearrange Stretched Column
5/* ====================================== */
6var cspt_rearrange_stretched_col = function( model_id ) {
7	if( jQuery('body').hasClass('elementor-editor-active') ){
8		jQuery( '*[data-id="'+model_id+'"]' ).each(function(){
9			jQuery('.cspt-stretched-div', this).remove();
10			jQuery('.elementor-widget-wrap', this).removeAttr('style');
11			setTimeout(function(){ cspt_stretched_col(); }, 50);
12		});	
13	}
14}
15
16/* ====================================== */
17/* Stretched Column
18/* ====================================== */
19var cspt_stretched_col = function() {
20
21	jQuery('.elementor-section.elementor-top-section').each(function(){
22		if( jQuery(this).hasClass('cspt-col-stretched-left') || jQuery(this).hasClass('cspt-col-stretched-right') || jQuery(this).hasClass('cspt-col-stretched-both') ){
23			jQuery(this).addClass('cspt-col-stretched-yes').removeClass('cspt-col-stretched-no');
24		} else {
25			jQuery(this).addClass('cspt-col-stretched-no').removeClass('cspt-col-stretched-yes');
26		}
27	});
28
29	// remove all stretched related changes in each column
30	jQuery('.elementor-section.elementor-top-section').each(function(){
31		var ThisSection = jQuery(this);
32		var ThisColumn	= '';
33		jQuery( '.elementor-column.elementor-top-column', ThisSection ).each(function(){
34			ThisColumn	= jQuery(this);
35			jQuery( '.cspt-stretched-div', ThisColumn ).remove();
36			ThisColumn.removeClass('cspt-col-stretched-yes cspt-col-stretched-left cspt-col-stretched-right cspt-col-stretched-content-yes');
37		});
38	});
39
40	// reset - Remove all inline css
41	jQuery('.elementor-section.elementor-top-section').each(function(){
42		jQuery( '.elementor-column.elementor-top-column', jQuery(this) ).each(function(){
43			if( jQuery(this).children('.elementor-column-wrap').length > 0 ){
44				jQuery(this).children('.elementor-column-wrap').removeAttr('style');
45			} else {
46				jQuery(this).children('.elementor-widget-wrap').removeAttr('style');
47			}
48		});
49	});
50
51	jQuery('.elementor-section.elementor-top-section.cspt-col-stretched-yes').each(function(){
52
53		var ThisSection		= jQuery(this);
54		var ThisColumn		= '';
55		var ColWrapper		= '';
56		var StretchedEle	= '';
57		var StretchedInnerEle = '';
58
59		if( ThisSection.hasClass('cspt-col-stretched-left') || ThisSection.hasClass('cspt-col-stretched-both') ){
60			ThisColumn = jQuery( '.elementor-column.elementor-top-column', ThisSection ).first();
61
62			if( jQuery('.cspt-stretched-div', ThisColumn).length == 0 ){
63
64				if( ThisColumn.children('.elementor-column-wrap').length > 0 ){
65					ColWrapper = ThisColumn.children('.elementor-column-wrap');
66				} else {
67					ColWrapper = ThisColumn.children('.elementor-widget-wrap');
68				}
69
70				ColWrapper.prepend( '<div class="cspt-stretched-div"></div>' );
71
72				// Stretched Element
73				StretchedEle = ColWrapper.children('.cspt-stretched-div');
74
75				// RTL
76				if( jQuery('body').hasClass('rtl') ){
77					StretchedEle.addClass( 'cspt-stretched-right cspt-stretched-for-rtl' );
78					ThisColumn.addClass('cspt-col-stretched-yes cspt-col-stretched-right cspt-col-stretched-for-rtl');
79				} else {
80					StretchedEle.addClass( 'cspt-stretched-left' );
81					ThisColumn.addClass('cspt-col-stretched-yes cspt-col-stretched-left');
82				}
83
84				// specially for Skew view only
85				if( ThisColumn.hasClass('cspt-skew-yes') ){
86					StretchedEle.prepend( '<div class="cspt-stretched-inner-div"></div>' );
87					StretchedInnerEle = StretchedEle.children('.cspt-stretched-inner-div');
88					StretchedInnerEle.css('position', 'absolute');
89					StretchedInnerEle.css('width', '100%');
90					StretchedInnerEle.css('height', '100%');
91				}
92
93				if( ThisSection.hasClass('cspt-left-col-stretched-content-yes') ){
94					ThisColumn.addClass('cspt-col-stretched-content-yes');
95				} else {
96					ThisColumn.removeClass('cspt-col-stretched-content-yes');
97				}
98
99				// background move to stretched div
100				ColWrapper.removeAttr('style');
101				var bgImage =  ColWrapper.css('background-image');
102				if( bgImage!='none' && bgImage!='' ){
103					// specially for Skew view only
104					if( ThisColumn.hasClass('cspt-skew-yes') ){
105						StretchedInnerEle.css('background-image', bgImage );
106					} else {
107						StretchedEle.css('background-image', bgImage );
108					}
109					ColWrapper.css('background-image', 'none');
110				}
111
112				// border radious
113				ColWrapper.css('border-top-left-radius', '');
114				ColWrapper.css('border-top-right-radius', '');
115				ColWrapper.css('border-bottom-left-radius', '');
116				ColWrapper.css('border-bottom-right-radius', '');
117				var radius_t_left  =  ColWrapper.css('border-top-left-radius');
118				var radius_t_right =  ColWrapper.css('border-top-right-radius');
119				var radius_b_left  =  ColWrapper.css('border-bottom-left-radius');
120				var radius_b_right =  ColWrapper.css('border-bottom-right-radius');
121				if( radius_t_left!='0' && radius_t_left!='' ){
122					StretchedEle.css('border-top-left-radius', radius_t_left );
123					ColWrapper.css('border-top-left-radius', '0');
124				}
125				if( radius_t_right!='0' && radius_t_right!='' ){
126					StretchedEle.css('border-top-right-radius', radius_t_right );
127					ColWrapper.css('border-top-right-radius', '0');
128				}
129				if( radius_b_left!='0' && radius_b_left!='' ){
130					StretchedEle.css('border-bottom-left-radius', radius_b_left );
131					ColWrapper.css('border-bottom-left-radius', '0');
132				}
133				if( radius_b_right!='0' && radius_b_right!='' ){
134					StretchedEle.css('border-bottom-right-radius', radius_b_right );
135					ColWrapper.css('border-bottom-right-radius', '0');
136				}
137
138				// Background Color
139				var bgColor = ColWrapper.css('background-color');
140
141				if( bgColor && bgColor!='' ){
142
143					if( bgColor.indexOf('rgba') != -1 ){ // check if RGB or RGBA
144
145						var bgColorArray = bgColor.split(',');
146						var colors = [];
147						jQuery(bgColorArray).each(function(x,y){
148							y = y.replace( 'rgba' , '' );
149							y = y.replace( '(' , '' );
150							y = y.replace( ')' , '' );
151							y = y.trim();
152							colors.push(y);
153						});
154
155						bgColor = 'rgb(';
156						var loopx = 1;
157						var opacity = 'n'
158						jQuery.each( colors , function( index, value ) {
159							if ( loopx == 1 ){
160								bgColor += value;
161							} else if ( loopx == 2 || loopx == 3 ){
162								bgColor += ',' + value;
163							} else if ( loopx == 4 && ( value == '0' || value == 0 ) ){
164								opacity = 'y';
165							}
166							loopx = loopx + 1;
167						});
168						bgColor += ')';
169
170						if ( opacity == 'y' ){
171							bgColor = 'transparent';
172						}
173
174					}
175
176					// specially for Skew view only
177					if( ThisColumn.hasClass('cspt-skew-yes') ){
178						StretchedInnerEle.css('background-color', bgColor );
179					} else {
180						StretchedEle.css('background-color', bgColor );
181					}
182					
183					ColWrapper.css('background-color', 'transparent');
184				}
185
186				// Background Position
187				var bgPosition = ColWrapper.css('background-position');
188				if( bgPosition!='' ){
189					if( ThisColumn.hasClass('cspt-skew-yes') ){
190						StretchedInnerEle.css('background-position', bgPosition );
191					} else {
192						StretchedEle.css('background-position', bgPosition );
193					}
194				}
195
196				// Background Repeat
197				var bgRepeat = ColWrapper.css('background-repeat');
198				if( bgRepeat!='' ){
199					if( ThisColumn.hasClass('cspt-skew-yes') ){
200						StretchedInnerEle.css('background-repeat', bgRepeat );
201					} else {
202						StretchedEle.css('background-repeat', bgRepeat );
203					}
204				}
205
206				// Background Size
207				var bgSize = ColWrapper.css('background-size');
208				if( bgSize!='' ){
209					if( ThisColumn.hasClass('cspt-skew-yes') ){
210						StretchedInnerEle.css('background-size', bgSize );
211					} else {
212						StretchedEle.css('background-size', bgSize );
213					}
214				}
215
216				cspt_stretched_col_calc();
217
218			}
219
220		}
221
222		if( ThisSection.hasClass('cspt-col-stretched-right') || ThisSection.hasClass('cspt-col-stretched-both') ){
223			ThisColumn = jQuery( '.elementor-column.elementor-top-column', ThisSection ).last();
224
225			if( jQuery('.cspt-stretched-div', ThisColumn).length==0 ){
226
227				if( ThisColumn.children('.elementor-column-wrap').length > 0 ){
228					ColWrapper = ThisColumn.children('.elementor-column-wrap');
229				} else {
230					ColWrapper = ThisColumn.children('.elementor-widget-wrap');
231				}
232
233				ColWrapper.prepend( '<div class="cspt-stretched-div"></div>' );
234
235				// Stretched Element
236				StretchedEle = ColWrapper.children('.cspt-stretched-div');
237
238				// RTL
239				if( jQuery('body').hasClass('rtl') ){
240					StretchedEle.addClass( 'cspt-stretched-left cspt-stretched-for-rtl' );
241					ThisColumn.addClass('cspt-col-stretched-yes cspt-col-stretched-left cspt-col-stretched-for-rtl');
242				} else {
243					StretchedEle.addClass( 'cspt-stretched-right' );
244					ThisColumn.addClass('cspt-col-stretched-yes cspt-col-stretched-right');
245				}
246
247				// specially for Skew view only
248				if( ThisColumn.hasClass('cspt-skew-yes') ){
249					StretchedEle.prepend( '<div class="cspt-stretched-inner-div"></div>' );
250					StretchedInnerEle = StretchedEle.children('.cspt-stretched-inner-div');
251					StretchedInnerEle.css('position', 'absolute');
252					StretchedInnerEle.css('width', '100%');
253					StretchedInnerEle.css('height', '100%');
254				}
255
256				if( ThisSection.hasClass('cspt-right-col-stretched-content-yes') ){
257					ThisColumn.addClass('cspt-col-stretched-content-yes');
258				} else {
259					ThisColumn.removeClass('cspt-col-stretched-content-yes');
260				}
261
262				// background move to stretched div
263				ColWrapper.removeAttr('style');
264				var bgImage = ColWrapper.css('background-image');
265				if( bgImage!='none' && bgImage!='' ){
266					// specially for Skew view only
267					if( ThisColumn.hasClass('cspt-skew-yes') ){
268						StretchedInnerEle.css('background-image', bgImage );
269					} else {
270						StretchedEle.css('background-image', bgImage );
271					}
272					ColWrapper.css('background-image', 'none');
273				}
274
275				// border radious
276				ColWrapper.css('border-top-left-radius', '');
277				ColWrapper.css('border-top-right-radius', '');
278				ColWrapper.css('border-bottom-left-radius', '');
279				ColWrapper.css('border-bottom-right-radius', '');
280				var radius_t_left  =  ColWrapper.css('border-top-left-radius');
281				var radius_t_right =  ColWrapper.css('border-top-right-radius');
282				var radius_b_left  =  ColWrapper.css('border-bottom-left-radius');
283				var radius_b_right =  ColWrapper.css('border-bottom-right-radius');
284				if( radius_t_left!='0' && radius_t_left!='' ){
285					StretchedEle.css('border-top-left-radius', radius_t_left );
286					ColWrapper.css('border-top-left-radius', '0');
287				}
288				if( radius_t_right!='0' && radius_t_right!='' ){
289					StretchedEle.css('border-top-right-radius', radius_t_right );
290					ColWrapper.css('border-top-right-radius', '0');
291				}
292				if( radius_b_left!='0' && radius_b_left!='' ){
293					StretchedEle.css('border-bottom-left-radius', radius_b_left );
294					ColWrapper.css('border-bottom-left-radius', '0');
295				}
296				if( radius_b_right!='0' && radius_b_right!='' ){
297					StretchedEle.css('border-bottom-right-radius', radius_b_right );
298					ColWrapper.css('border-bottom-right-radius', '0');
299				}
300
301				// Background Color
302				var bgColor = ColWrapper.css('background-color');
303				if( bgColor && bgColor!='' ){
304					if( bgColor.indexOf('rgba') != -1 ){ // check if RGB or RGBA
305						var bgColorArray = bgColor.split(',');
306
307						var colors = [];
308						jQuery(bgColorArray).each(function(x,y){
309							y = y.replace( 'rgba' , '' );
310							y = y.replace( '(' , '' );
311							y = y.replace( ')' , '' );
312							y = y.trim();
313							colors.push(y);
314						});
315						
316						bgColor = 'rgb(';
317						var loopx = 1;
318						var opacity = 'n'
319						jQuery.each( colors , function( index, value ) {
320							if ( loopx == 1 ){
321								bgColor += value;
322							} else if ( loopx == 2 || loopx == 3 ){
323								bgColor += ',' + value;
324							} else if ( loopx == 4 && ( value == '0' || value == 0 ) ){
325								opacity = 'y';
326							}
327							loopx = loopx + 1;
328						});
329						bgColor += ')';
330
331						if ( opacity == 'y' ){
332							bgColor = 'transparent';
333						}
334
335					}
336
337					// specially for Skew view only
338					if( ThisColumn.hasClass('cspt-skew-yes') ){
339						StretchedInnerEle.css('background-color', bgColor );
340					} else {
341						StretchedEle.css('background-color', bgColor );
342					}
343					ColWrapper.css('background-color', 'transparent');
344				}
345
346				// Background Position
347				var bgPosition = ColWrapper.css('background-position');
348				if( bgPosition!='' ){
349					if( ThisColumn.hasClass('cspt-skew-yes') ){
350						StretchedInnerEle.css('background-position', bgPosition );
351					} else {
352						StretchedEle.css('background-position', bgPosition );
353					}
354				}
355
356				// Background Repeat
357				var bgRepeat = ColWrapper.css('background-repeat');
358				if( bgRepeat!='' ){
359					if( ThisColumn.hasClass('cspt-skew-yes') ){
360						StretchedInnerEle.css('background-repeat', bgRepeat );
361					} else {
362						StretchedEle.css('background-repeat', bgRepeat );
363					}
364				}
365
366				// Background Size
367				var bgSize = ColWrapper.css('background-size');
368				if( bgSize!='' ){
369					if( ThisColumn.hasClass('cspt-skew-yes') ){
370						StretchedInnerEle.css('background-size', bgSize );
371					} else {
372						StretchedEle.css('background-size', bgSize );
373					}
374				}
375
376				cspt_stretched_col_calc();
377
378			}
379		}
380
381	});
382
383};
384
385var cspt_stretched_col_calc = function() {
386
387	// padding left or right
388	if( jQuery('.elementor-section.elementor-top-section > .elementor-container .elementor-column.elementor-top-column.cspt-col-stretched-yes').length>0 ){
389
390		// Returns width of browser viewport
391		var window_width = jQuery( window ).width();
392
393		// Returns width of HTML document
394		var document_width = jQuery( document ).width();
395
396		jQuery('.elementor-section.elementor-top-section > .elementor-container .elementor-column.elementor-top-column.cspt-col-stretched-yes').each(function(){
397
398			if( jQuery(this).closest('.elementor-section.elementor-top-section').hasClass('cspt-col-stretched-both') && ( jQuery(this).hasClass('elementor-col-100') || jQuery(this).attr('data-col') == '100' ) ){
399				// Do nothing
400			} else {
401				var this_ele    = jQuery(this);
402				var curr_width  = jQuery(this).closest('.elementor-container').width();
403				var extra_width = ((window_width - curr_width)/2);
404				var parent_width = '';
405
406				if( this_ele.hasClass('cspt-skew-yes') ){
407					extra_width = extra_width + 100;
408				}
409
410				var position = 'left';
411				if( jQuery(this).hasClass('cspt-col-stretched-right') ){
412					position = 'right';
413				}
414
415				// set width to 100% if parent is 100%
416				parent_width = jQuery(this).width();
417				if( parent_width == '100%' ){
418					jQuery(this).children('.elementor-widget-wrap') .css('width','100%');
419					jQuery(this).children('.elementor-column-wrap') .css('width','100%');
420				} else {
421					jQuery(this).children('.elementor-widget-wrap') .css('width','');
422					jQuery(this).children('.elementor-column-wrap') .css('width','');
423				}
424
425				jQuery('.cspt-stretched-div', jQuery(this)).css( 'margin-'+position,'-'+extra_width+'px' );
426
427				// stretched column content too
428				if( jQuery(this).hasClass('cspt-col-stretched-content-yes') ){
429					
430					jQuery('.cspt-stretched-div', jQuery(this)).css( 'margin-'+position, "" );
431					var stretched_width = jQuery('.cspt-stretched-div', jQuery(this) ).width() + extra_width;
432					if( jQuery(this).children('.elementor-column-wrap').length > 0 ){
433						jQuery(this).children('.elementor-column-wrap').css( 'margin-'+position,'-'+extra_width+'px' );
434						jQuery(this).children('.elementor-column-wrap').css( 'width', stretched_width+'px' );
435					} else {
436						jQuery(this).children('.elementor-widget-wrap').css( 'margin-'+position,'-'+extra_width+'px' );
437						jQuery(this).children('.elementor-widget-wrap').css( 'width', stretched_width+'px' );
438					}
439
440				} else {
441					if( jQuery(this).children('.elementor-column-wrap').length > 0 ){
442						jQuery(this).children('.elementor-column-wrap').css( 'margin-'+position,'' );
443						jQuery(this).children('.elementor-column-wrap').css( 'width', '' );
444					} else {
445						jQuery(this).children('.elementor-widget-wrap').css( 'margin-'+position,'' );
446						jQuery(this).children('.elementor-widget-wrap').css( 'width', '' );
447					}
448				}
449
450		}
451
452		});
453
454	}
455
456}
457
458/* ============================================== */
459/* BG Image yes class in each Section and Column
460/* ============================================== */
461var cspt_bgimage_class = function() {
462	jQuery('.elementor-section.elementor-top-section').each(function() {
463
464		if( jQuery(this).css('background-image')!='' && jQuery(this).css('background-image')!='none' ){
465			jQuery(this).addClass('cspt-bgimage-yes' ).removeClass('cspt-bgimage-no' );
466		} else {
467			jQuery(this).addClass('cspt-bgimage-no' ).removeClass('cspt-bgimage-yes' );
468		}
469	});
470	jQuery('.elementor-column.elementor-top-column').each(function() {
471
472		if( jQuery(this).children('.elementor-column-wrap').length > 0 ){
473
474			if( jQuery(this).children('.elementor-column-wrap').children('.cspt-stretched-div').length > 0 ){
475
476				if( jQuery(this).children('.elementor-column-wrap').children('.cspt-stretched-div').css('background-image') == 'none' || jQuery(this).children('.elementor-column-wrap').children('.cspt-stretched-div').css('background-image') == '' ){
477					jQuery(this).addClass('cspt-bgimage-no' ).removeClass('cspt-bgimage-yes' );
478				} else {
479					jQuery(this).addClass('cspt-bgimage-yes' ).removeClass('cspt-bgimage-no' );
480				}
481
482			} else {
483
484				if( jQuery(this).children('.elementor-column-wrap').css('background-image') == 'none' || jQuery(this).children('.elementor-column-wrap').css('background-image') == '' ){
485					jQuery(this).addClass('cspt-bgimage-no' ).removeClass('cspt-bgimage-yes' );
486				} else {
487					jQuery(this).addClass('cspt-bgimage-yes' ).removeClass('cspt-bgimage-no' );
488				}
489
490			}
491
492		} else {
493
494			if( jQuery(this).children('.elementor-widget-wrap').children('.cspt-stretched-div').length > 0 ){
495
496				if( jQuery(this).children('.elementor-widget-wrap').children('.cspt-stretched-div').css('background-image') == 'none' || jQuery(this).children('.elementor-widget-wrap').children('.cspt-stretched-div').css('background-image') == '' ){
497					jQuery(this).addClass('cspt-bgimage-no' ).removeClass('cspt-bgimage-yes' );
498				} else {
499					jQuery(this).addClass('cspt-bgimage-yes' ).removeClass('cspt-bgimage-no' );
500				}
501
502			} else {
503
504				if( jQuery(this).children('.elementor-widget-wrap').css('background-image') == 'none' || jQuery(this).children('.elementor-widget-wrap').css('background-image') == '' ){
505					jQuery(this).addClass('cspt-bgimage-no' ).removeClass('cspt-bgimage-yes' );
506				} else {
507					jQuery(this).addClass('cspt-bgimage-yes' ).removeClass('cspt-bgimage-no' );
508				}
509
510			}
511
512		}
513	});
514};
515
516/* ============================================== */
517/* BG Color yes class in each Section and Column
518/* ============================================== */
519var cspt_bgcolor_class = function() {
520	jQuery('.elementor-section.elementor-top-section').each(function() {
521		if( jQuery(this).css('background-color')!='' && jQuery(this).css('background-color')!='transparent' ){
522			jQuery(this).addClass('cspt-bgcolor-yes');
523		}
524	});
525	jQuery('.elementor-column.elementor-top-column').each(function() {
526		if( jQuery(this).children('.cspt-stretched-div').length ){
527			if( jQuery(this).children('.cspt-stretched-div').css('background-color')!='' && jQuery(this).children('.cspt-stretched-div').css('background-color')!='transparent' ){
528				jQuery(this).addClass('cspt-bgcolor-yes' ).removeClass('cspt-bgcolor-no' );
529			} else {
530				jQuery(this).addClass('cspt-bgcolor-no' ).removeClass('cspt-bgcolor-yes' );
531			}
532		} else {
533
534
535			if( jQuery(this).children('.elementor-column-wrap').length > 0 ){
536
537				if( jQuery(this).children('.elementor-column-wrap').css('background-color') == 'transparent' || jQuery(this).children('.elementor-column-wrap').css('background-color') == '' ){
538					jQuery(this).addClass('cspt-bgcolor-no' ).removeClass('cspt-bgcolor-yes' );
539				} else {
540					jQuery(this).addClass('cspt-bgcolor-yes' ).removeClass('cspt-bgcolor-no' );
541				}
542
543			} else {
544
545				if( jQuery(this).children('.elementor-widget-wrap').css('background-color') == 'transparent' || jQuery(this).children('.elementor-widget-wrap').css('background-color') == '' ){
546					jQuery(this).addClass('cspt-bgcolor-no' ).removeClass('cspt-bgcolor-yes' );
547				} else {
548					jQuery(this).addClass('cspt-bgcolor-yes' ).removeClass('cspt-bgcolor-no' );
549				}
550
551			}
552
553		}
554	});
555};
556
557/*----  Events  ----*/
558
559// On resize
560jQuery(window).resize(function(){
561	setTimeout(function() {
562		cspt_stretched_col_calc();
563	}, 100);
564});
565
566// on ready
567jQuery(document).ready(function(){
568	cspt_stretched_col();
569	cspt_stretched_col_calc();
570	cspt_bgimage_class();
571	cspt_bgcolor_class();
572	setTimeout(function() {
573		cspt_stretched_col_calc();
574	}, 100);
575});

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.