PageSourceSearch

https://www.thebirdclinic.com/themes/website/assets/js/theme.js?v.a0557f

js thebirdclinic.com collected 2026-09-25 06:50:37 UTC 8,904 bytes, 268 lines download raw bytes

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

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.