PageSourceSearch

https://www.coloradoicsb.com/themes/website/assets/js/theme.js?v.284928

js coloradoicsb.com collected 2026-10-04 13:28:05 UTC 8,922 bytes, 260 lines download raw bytes

1$(document).ready(function() {
2    
3	$(".preview_iframe").height($(window).height());
4
5	var sliderTimer, // timer var for slider's inlineImageParallax func
6		contactFormTimer; // timer var for layoutContactForm func
7
8	// mmenu subnav indication helpers
9	var menu = $('#navigation_header'),
10		menuParent = menu.parent(),
11		menuList = menu.find('ul'),
12		subnavClass = 'sublevel-';
13
14	// loop through main navigation, define if there are any sub-levels and wrap into container with corresponding class name
15	// the function is needed because mmenu doesn't provide this functionality, and we need it to style sub-levels differently, with their own color schemes
16	navigationSublevelWrap(menuList, subnavClass);
17
18	// init mmenu
19	menu.clone().attr('id', 'navigation--mobile').mmenu({
20		extensions: ["multiline"]
21	});
22	
23	// init more nav - the rest of init that needs to be updated after switching from tablet/mobile to desktop is below
24	// should be called after mmenu init to eliminate  MORE nav's structure inheritance by mmenu
25	// this function will be called only once, on document.ready or window.load
26	if ($('.navigation').not('.mm-menu').data('more-button') === 1) {
27		window.moreButton = $('<li class="navigation__item has-child more"> <a href="#">More</a> <ul class="navigation__list--sub"></ul> </li>');
28		
29		// custom JS for theme
30		// class is needed to add specific classes for nav with enabled/disabled more_nav option
31		var	mainNav = $('.navigation').not('.mm-menu').find('.navigation__list').eq(0),
32			moreNavActiveClass = 'more_nav--active';
33
34		if(!mainNav.hasClass(moreNavActiveClass)) {
35			mainNav.addClass(moreNavActiveClass);
36		} else {
37			mainNav.removeClass(moreNavActiveClass);
38		}
39	}
40
41	// move hamburger button inside nav container
42	$('#hamburger').moveElement({
43		place: menuParent
44	});
45
46
47
48	// keep same height for featureblocks content
49	$('.featuredblocks__list').sameHeight({
50		elements: '.featuredblock__title',
51		useMinHeight: true,
52		flexible: true,
53		multiLine: true
54	});
55
56	$('.featuredblocks__list').sameHeight({
57		elements: '.featuredblock__description',
58		useMinHeight: true,
59		flexible: true,
60		multiLine: true
61	});
62
63	// staff structure helpers
64	var staff = $('.wrap__staff'),
65		staffItem = staff.find('.staff-member');
66
67	staffItem.each(function() {
68		var item = $(this),
69			wrapElems = item.find($('.staff-member__prefix, .staff-member__name, .staff-member__suffix'));
70
71		// wrap repfix and name into common parent holder
72		wrapElems.wrapAll('<div class="staff-member__heading" />');
73	});
74
75	// wrap testimonials content, it's not possible to style per design with current structure
76	$('.testimonials__list .testimonials__item').each(function() {
77		var item = $(this),
78			itemContent = item.children();
79
80		itemContent.wrapAll("<div class='testimonials__group'>");
81	});
82
83	// check if form component exists on page
84	if ($('.form').length) {
85		// attach custom SMBLeadsFormReady event on body
86		$('body').on('SMBLeadsFormReady', function() {
87			// wrap group fields into single parent
88			$('.wrap__form.alt .leadForm').each(function() {
89				var altForm = $(this),
90					altFormWrapGroup = altForm.find('.wrap__group');
91
92				if (!altFormWrapGroup.length) {
93					var group = altForm.find('.form__group');
94
95					group.wrapAll("<div class='wrap__group'>");
96				}
97			});
98		});
99	}
100
101	// change icon position in button
102	$('.featuredblock__button').each(function() {
103		var button = $(this),
104			icon = button.find('.icon'),
105			text = button.find('.featuredblock__button-text');
106
107		if (icon.length) {
108			icon.remove();
109			return text.append(icon);
110		}
111	});
112
113	// init more nav - the rest of init that needs to be updated after switching from tablet/mobile to desktop is below
114	// should be called after mmenu init to eliminate  MORE nav's structure inheritance by mmenu
115	// this function will be called only once, on document.ready or window.load
116	if ($('.navigation').not('.mm-menu').data('more-button') === 1) {
117		window.moreButton = $('<li class="navigation__item has-child more"> <a href="#">More</a> <ul class="navigation__list--sub"></ul> </li>');
118	}
119
120	// moreNavResizeUpdate function will be triggered on resize
121	// Put functions inside moreNavResizeUpdate that need to be updated on resize
122	function moreNavResizeUpdate() {
123		window.currentMenuWidth = window.menuHolder.outerWidth();
124		// this function will be needed on resize
125		addMoreButton();
126		// moreNav helper - re-initiate content wrapper for more nav content
127		moreNav();
128
129		// prepare desktop nav for accordion
130		$('.navigation:not(.mm-menu) .navigation__list>li>div>ul').desktopDropNav();
131		// accordion for desktop nav
132		$('.navigation:not(.mm-menu)').slideAccordion({
133			activeClass: 'open-close--active',
134			opener: '>a span.opener',
135			slider: '>div.slide',
136			animSpeed: 300
137		});
138
139		$('.navigation:not(.mm-menu) > ul').dropdownFit({
140			dropDown: '>li>div>ul'
141		});
142		
143        // main nav drop down max height calculation
144		$('.navigation:not(.mm-menu) .sublevel-1').each(function(){
145			$(this).scrollArea({
146				heightProp: 'maxHeight',
147				recalcOnPageScroll: true,
148				setScrollTo: '> .navigation__list--sub'
149			});
150		});
151	}
152
153	// handle layout resize
154	ResponsiveHelper.addRange({
155		'1025..': {
156			on: function() {
157				if ($('.navigation').not('.mm-menu').data('more-button') === 1) {
158					menuPrepare();
159					// init more nav
160					window.currentMenuWidth = window.menuHolder.outerWidth();
161					// this function will be needed on resize
162					addMoreButton();
163					// moreNav helper - reinitiate content wrapper for more nav content
164					moreNav();
165					// update moreNav on resize
166					$(window).on('resize orientationchange', moreNavResizeUpdate);
167				}
168
169				// prepare desktop nav for accordion
170				$('.navigation:not(.mm-menu) .navigation__list>li>div>ul').desktopDropNav();
171				// accordion for desktop nav
172				$('.navigation:not(.mm-menu)').slideAccordion({
173					activeClass: 'open-close--active',
174					opener: '>a span.opener',
175					slider: '>div.slide',
176					animSpeed: 300
177				});
178
179				$('.navigation:not(.mm-menu) > ul').dropdownFit({
180					dropDown: '>li>div>ul'
181				});
182
183				// close mmenu on desktop
184				$('#navigation--mobile').data('mmenu').close();
185
186				// set position fixed on scroll
187				$('body').fixedScrollBlock({
188					fixedActiveClass: 'fixed',
189					slideBlock: '.wrap__rotate-container--bottom',
190					fixedOnlyIfFits: false
191				});
192			},
193			off: function() {
194				if ($('.navigation').not('.mm-menu').data('more-button') === 1) {
195					// destroy update moreNav on resize
196					$(window).off('resize orientationchange', moreNavResizeUpdate);
197				}
198
199				// destroy dropdownFit
200				$('.navigation:not(.mm-menu) > ul').data('dropdownFit').destroy();
201                
202                // destroy main nav drop down max height calculation
203    			setTimeout(function(){
204    				$('.navigation:not(.mm-menu) .sublevel-1').each(function(){
205    					if (typeof $(this).data('scrollArea') !== 'undefined') {
206    						$(this).data('scrollArea').destroy();
207    					}
208    				});
209    			}, 100);
210
211				// destroy set position fixed on scroll
212				$('body').data('FixedScrollBlock').destroy();
213			}
214		},
215		'..1024': {
216			on: function() {
217
218				// move header out of wrapper created by mmenu
219				$('.wrap__rotate-container--bottom, .wrap__header.interior').moveElement({
220					place: 'body'
221				});
222			},
223			off: function() {
224				// destroy and move header back to its inital desktop position
225				if (typeof $('.wrap__rotate-container--bottom, .wrap__header.interior').data('moveElement') !== 'undefined') {
226					$('.wrap__rotate-container--bottom, .wrap__header.interior').data('moveElement').destroy();
227				}
228
229				// destroy and move map heading back into 2-column grid (per design)
230				if (typeof $('.office-info-map').data('moveElement') !== 'undefined') {
231					$('.office-info-map').data('moveElement').destroy();
232				}
233			}
234		},
235		'768..': {
236			on: function() {
237				// check if form component exists on page
238				if ($('.form').length) {
239					// this part is initialized on forms load
240					$('body').on('SMBLeadsFormReady', function() {
241						// init contact form layout
242						$('.wrap__form.contact .leadForm, .wrap__form.appointment .leadForm').layoutContactForm();
243
244					});
245					// this part is initialized on resolution change
246					// init contact form layout
247					$('.wrap__form.contact .leadForm, .wrap__form.appointment .leadForm').layoutContactForm();
248				}
249			},
250			off: function() {
251				// destroy layoutContactForm
252				$('.wrap__form.contact .leadForm, .wrap__form.appointment .leadForm').each(function() {
253					if (typeof $(this).data('layoutContactForm') !== 'undefined') {
254						$(this).data('layoutContactForm').destroy();
255					}
256				});
257			}
258		}
259	});
260});

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.