PageSourceSearch

https://performinglifebolivia.org/wp-content/themes/enfold/config-…/tab_section/tab_section_ver-4.9.26.js

js performinglifebolivia.org collected 2026-09-27 08:56:50 UTC 7,697 bytes, 230 lines download raw bytes

1var _____WB$wombat$assign$function_____=function(name){return (self._wb_wombat && self._wb_wombat.local_init && self._wb_wombat.local_init(name))||self[name];};if(!self.__WB_pmw){self.__WB_pmw=function(obj){this.__WB_source=obj;return this;}}{
2let window = _____WB$wombat$assign$function_____("window");
3let self = _____WB$wombat$assign$function_____("self");
4let document = _____WB$wombat$assign$function_____("document");
5let location = _____WB$wombat$assign$function_____("location");
6let top = _____WB$wombat$assign$function_____("top");
7let parent = _____WB$wombat$assign$function_____("parent");
8let frames = _____WB$wombat$assign$function_____("frames");
9let opens = _____WB$wombat$assign$function_____("opens");
10(function($)
11{ 
12	"use strict";
13	
14	// -------------------------------------------------------------------------------------------
15	// Tab Section
16	// -------------------------------------------------------------------------------------------
17	
18	$.fn.avia_sc_tab_section= function()
19	{
20		var win 			= $(window),
21			browserPrefix 	= $.avia_utilities.supports('transition'),
22			cssActive 		= this.browserPrefix !== false ? true : false,
23			isMobile 		= $.avia_utilities.isMobile,
24			transform3d		= document.documentElement.className.indexOf('avia_transform3d') !== -1 ? true : false,
25			transition		= {};
26			
27		return this.each(function()
28		{
29			var container 		= $(this),
30				tabs			= container.find('.av-section-tab-title'),
31			    tab_outer		= container.find('.av-tab-section-outer-container'),
32				tab_wrap		= container.find('.av-tab-section-tab-title-container'),
33				tab_nav			= container.find('.av_tab_navigation'), 
34				content_wrap	= container.find('.av-tab-section-inner-container'),
35				single_tabs		= container.find('.av-animation-delay-container'), //for elements inside the tab that receive waypoint animation
36				inner_content	= container.find('.av-layout-tab-inner'),
37				sliding_active  = container.is('.av-tab-slide-transition'),
38				flexible    	= container.is('.av-tab-content-auto'),
39				current_content = container.find('.__av_init_open'),
40				min_width		= 0,
41				change_tab 		= function(e, prevent_hash)
42				{
43					e.preventDefault();
44					
45					var current_tab 	= $(e.currentTarget),
46						current_arrow	= current_tab.find('.av-tab-arrow-container span'),
47						tab_nr			= current_tab.data('av-tab-section-title');
48						
49						current_content = container.find('[data-av-tab-section-content="'+tab_nr+'"]');
50					
51					var new_bg			= current_content.data('av-tab-bg-color'),
52						new_font		= current_content.data('av-tab-color'),
53						prev_container 	= container.find('.av-active-tab-content').not('[data-av-tab-section-content="'+tab_nr+'"]');
54	
55					tabs.attr('style','').removeClass('av-active-tab-title');
56					current_tab.addClass('av-active-tab-title');
57					current_content.addClass("av-active-tab-content");
58					
59					if(new_bg !== "") current_arrow.css('background-color', new_bg);
60					if(new_font !== "") current_tab.css('color', new_font);
61						
62					var new_pos = ((parseInt(tab_nr,10) - 1) * -100 );
63					    if ($('body').hasClass('rtl')) {
64	        				new_pos = ((parseInt(tab_nr,10) - 1) * 100 );
65	    					}
66					
67					if(cssActive)
68					{
69						//move the slides
70						new_pos = new_pos / tabs.length;
71						transition['transform']  = transform3d ? "translate3d(" + new_pos  + "%, 0, 0)" : "translate(" + new_pos + "%,0)"; //3d or 2d transform?
72						transition['left'] = "0%";
73						content_wrap.css(transition);
74					}
75					else
76					{
77						content_wrap.css('left',  new_pos + "%");
78					}
79					
80					set_tab_titlte_pos();
81					set_slide_height();
82					
83					if(!prevent_hash) location.hash = current_tab.attr('href');
84					
85					setTimeout(function()
86					{
87						current_content.trigger('avia_start_animation_if_current_slide_is_active');
88						single_tabs.not(current_content).trigger('avia_remove_animation');
89						
90					}, 600);	
91					
92				},
93				set_min_width = function()
94				{
95					min_width = 0;
96					tabs.each(function()
97					{ 
98						min_width += $(this).outerWidth(); 
99					});
100					
101					tab_wrap.css('min-width',min_width);
102				},
103				
104				set_slide_height = function()
105				{				
106					if(current_content.length && flexible)
107					{
108						var old_height = inner_content.height();
109						inner_content.height('auto');
110						
111						var height = current_content.find('.av-layout-tab-inner').height(),
112						    add_height = tab_wrap.height();
113						
114						tab_outer.css('max-height', height + add_height + 100);
115						inner_content.height(old_height);
116						inner_content.height(height);
117						
118						inner_content.css( 'overflow', 'hidden' );
119						
120						setTimeout(function() { win.trigger('av-height-change'); }, 600);
121					}
122				},
123				
124				set_tab_titlte_pos = function()
125				{
126					//	scroll the tabs if there is not enough room to display them all - rtl allign right to left !!
127					var current_tab = container.find('.av-active-tab-title'),
128						viewport	= container.width(),
129						left_pos	= ( current_tab.position().left * - 1) - (current_tab.outerWidth() / 2) + (viewport / 2);
130				
131					if( ! $('body').hasClass("rtl") )
132					{
133						if( viewport >= min_width )
134						{
135							left_pos = 0;
136						}
137						
138						if(left_pos + min_width < viewport) left_pos = (min_width - viewport) * -1;
139						if(left_pos > 0) left_pos = 0;
140					
141						tab_wrap.css('left',left_pos );
142					}
143					else
144					{
145						var right_pos = 0;
146						
147						if( viewport < min_width )
148						{
149							if( left_pos + min_width > viewport )
150							{
151								if( left_pos > 0 ) left_pos = 0;
152								
153								var right_pos = (left_pos + min_width - viewport) * -1;
154								tab_wrap.css('left', 'auto' );
155								tab_wrap.css('right', right_pos );
156							}
157						}
158						tab_wrap.css('left', 'auto' );
159						tab_wrap.css('right', right_pos );
160					}
161				},
162				switch_to_next_prev = function(e)
163				{
164					if(!isMobile) return;
165					
166					var clicked 		= $(e.currentTarget),
167						current_tab 	= container.find('.av-active-tab-title');
168						
169						if(clicked.is('.av_prev_tab_section'))
170						{
171							current_tab.prev('.av-section-tab-title').trigger('click');
172						}
173						else
174						{
175							current_tab.next('.av-section-tab-title').trigger('click');
176						}
177				},
178				
179				get_init_open = function()
180				{
181					if(!hash && window.location.hash) var hash = window.location.hash;
182		            		
183					var open = tabs.filter('[href="'+hash+'"]');
184					
185					if(open.length)
186					{
187						if(!open.is('.active_tab')) open.trigger('click');
188					}
189					else
190					{
191						//set correct color
192						container.find('.av-active-tab-title').trigger('click', true);
193					}
194				};
195					
196			$.avia_utilities.preload({
197				
198				container: current_content , 
199				single_callback:  function(){ 
200				
201					tabs.on('click', change_tab);
202					tab_nav.on('click', switch_to_next_prev);
203					win.on('debouncedresize', set_tab_titlte_pos);	
204					
205					/**
206					 * We had to remove av-height-change because this event is recursivly triggered in set_slide_height and lead to performance problems 
207					 * AND broken layout - content was not displayed completly
208					 * 
209					 * Content elements that can can change their height and trigger av-height-change should trigger this additional event after to
210					 * allow layout elements like tab section to react on this and then call av-height-change by themself
211					 * 
212					 * @since 4.2.3
213					 */
214					win.on('debouncedresize av-content-el-height-changed', set_slide_height);	
215					
216					set_min_width();
217					set_slide_height(); 
218					get_init_open();
219				}
220				
221			});	
222			
223			content_wrap.avia_swipe_trigger({prev:'.av_prev_tab_section', next:'.av_next_tab_section'});
224				
225		});
226	};
227	
228	
229}(jQuery));
230}

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.