1$(document).ready(function () { 2 var iframeElem = $(document).find('iframe'); 3 if($(iframeElem).length > 0) { 4 $(iframeElem).each(function() { 5 if($(this).attr('style')) { 6 var havingStyle = false; 7 if(!$(this).attr('width') && !$(this).attr('height')) { 8 var styles = $(this).attr('style').split(';'); 9 $.each(styles, function (index, val) { 10 if (val == 'width' || val == 'height') { 11 havingStyle = true; 12 } 13 }) 14 } 15 if (!havingStyle) { 16 $(this).attr({width: "100%", height: "500px"}) 17 } 18 } else { 19 if(!$(this).attr('width') && !$(this).attr('height')) { 20 $(this).attr({width: "100%", height: "500px"}) 21 } 22 } 23 }) 24 } 25 processSchemaData(); 26 $('.am-empty-container-parent').remove(); 27 colorRatio(); 28 fixDimensionlessSvgLogo(); 29 //quick fix to remove the "text-paragraph" label from the forms 30 $(".display_paragraph_value").closest('.control-group').find('label').hide(); 31 32 $(document).on('mouseover', 'header [data-navlink-id] ', function () { 33 $("header [data-havedropdown]").attr('data-havedropdown', 'false'); 34 $(this).parent().find('[data-havedropdown]').attr('data-havedropdown', 'true'); 35 }) 36 //to set all the contenteditable attribute as false 37 $(document).find('section [contenteditable="true"]').attr("contenteditable", "false"); 38 // Web Forms 39 if ($('.download_file_key_field').length) { 40 $('.download_file_button').show(); 41 $('.download_file_button').click(function () { 42 window.open(window.location.origin + '/download_web_form_file/' + $('.download_file_key_field').val() + ''); 43 return (false); 44 }) 45 } else { 46 $('.download_file_button').hide(); 47 } 48 $('.leads_form').submit(function (e) { 49 missing_required = false; 50 var $inputs = $(this).find(':input'); 51 var customName; 52 // adding index value if the input field has same name. 53 var values = []; 54 $inputs.each(function () { 55 var indexOfInput = ($inputs.index(this)); 56 if (jQuery.inArray(this.name, values) == -1) { 57 if (this.type == 'text' || this.type == 'textarea' || this.type == 'email' || this.type == 'hidden') { 58 values.push(this.name); 59 } 60 } else { 61 customName = this.name + 'jsIndexOfInputField' + indexOfInput; 62 values.push(customName); 63 $(this).attr('name', customName); 64 } 65 }); 66 // Gather required fields 67 $(this).find('.required_field').each(function () { 68 val = $(this).val(); 69 if (val == null) { 70 val = ''; 71 } else if ($.isArray(val)) { 72 val = $(this).val(); 73 } else { 74 val = val.trim(); 75 } 76 if (val == '') { 77 if ($(this).next('.required_info').length < 1) { 78 $(this).after('<span class="required_info"> - required field </span>') 79 } 80 if (!$(this).hasClass('field_error')) { 81 $(this).addClass('field_error') 82 } 83 if (missing_required == false) { 84 missing_required = true 85 } 86 } else { 87 $(this).removeClass('field_error') 88 } 89 }); 90 if (missing_required == true) { 91 return (false); 92 } 93 // Insert Emails (only check for main_email class) 94 var closestForm = $(e.target).closest('form'); 95 if (closestForm.find('.main_email') && closestForm.find('.main_email').length > 0) { 96 //main_email = $('<input />', name: 'main_email', value: $('.main_email').val(), type: 'text'); 97 main_email = $('<input />'); 98 main_email.val(closestForm.find('.main_email').attr('name')); 99 main_email.attr('name', 'foursight_main_email'); 100 main_email.attr('type', 'hidden'); 101 $('.leads_form').append(main_email); 102 } 103 if (closestForm.find('.main_phone') && closestForm.find('.main_phone').length > 0) { 104 main_phone = $('<input />'); 105 main_phone.val(closestForm.find('.main_phone').attr('name')); 106 main_phone.attr('name', 'foursight_main_phone'); 107 main_phone.attr('type', 'hidden'); 108 $('.leads_form').append(main_phone); 109 } 110 var mainName = closestForm.find('.main_name'); 111 if (mainName && mainName.length > 0 && mainName.length === 1) { 112 main_name = $('<input />'); 113 main_name.val(mainName.attr('name')); 114 main_name.attr('name', 'foursight_main_name'); 115 main_name.attr('type', 'hidden'); 116 $('.leads_form').append(main_name); 117 } 118 if (mainName && mainName.length > 0 && mainName.length > 1) { 119 var firstMatch = null; 120 mainName.each(function (index) { 121 var currentInput = $(this); 122 if (firstMatch === null) { 123 firstMatch = index; 124 main_first_name = $('<input />'); 125 main_first_name.val(currentInput.attr('name')); 126 main_first_name.attr('name', 'foursight_main_first_name'); 127 main_first_name.attr('type', 'hidden'); 128 $('.leads_form').append(main_first_name); 129 } else { 130 main_last_name = $('<input />'); 131 main_last_name.val(currentInput.attr('name')); 132 main_last_name.attr('name', 'foursight_main_last_name'); 133 main_last_name.attr('type', 'hidden'); 134 $('.leads_form').append(main_last_name); 135 } 136 }) 137 } 138 if (closestForm.find('.main_first_name') && closestForm.find('.main_first_name').length > 0) { 139 main_first_name = $('<input />'); 140 main_first_name.val(closestForm.find('.main_first_name').attr('name')); 141 main_first_name.attr('name', 'foursight_main_first_name'); 142 main_first_name.attr('type', 'hidden'); 143 $('.leads_form').append(main_first_name); 144 } 145 if (closestForm.find('.main_last_name') && closestForm.find('.main_last_name').length > 0) { 146 main_last_name = $('<input />'); 147 main_last_name.val(closestForm.find('.main_last_name').attr('name')); 148 main_last_name.attr('name', 'foursight_main_last_name'); 149 main_last_name.attr('type', 'hidden'); 150 $('.leads_form').append(main_last_name); 151 } 152 var $submitBtn = $(this).find(':submit'); 153 $submitBtn.prop('disabled', true); 154 setTimeout(function() { 155 $submitBtn.prop('disabled', false); 156 }, 5000); 157 158 }); 159 // Slick is optional when main.js is shared from CDN; missing $.fn.slick must not 160 // abort the rest of ready (accordion/nav in navLink() runs after this block). 161 if (typeof $.fn.slick === 'function') { 162 $('[data-slick].am-cover-slider-init').not('.slick-initialized').slick({ 163 slidesToShow: 1, 164 slidesToScroll: 1, 165 dots: true, 166 infinite: true, 167 // autoplay: true, 168 // autoplaySpeed: 2000,
169 }); 170 $('[data-slick].am-testimonial-init').not('.slick-initialized').slick({ 171 slidesToShow: 2, 172 slidesToScroll: 1, 173 responsive: [ 174 { 175 breakpoint: 1024, 176 settings: { 177 slidesToShow: 2, 178 slidesToScroll: 1, 179 infinite: true, 180 dots: true 181 } 182 }, 183 { 184 breakpoint: 769, 185 settings: { 186 slidesToShow: 2, 187 slidesToScroll: 1 188 } 189 }, 190 { 191 breakpoint: 600, 192 settings: { 193 slidesToShow: 1, 194 slidesToScroll: 1 195 } 196 }, 197 { 198 breakpoint: 480, 199 settings: { 200 slidesToShow: 1, 201 slidesToScroll: 1 202 } 203 } 204 // You can unslick at a given breakpoint now by adding: 205 // settings: "unslick" 206 // instead of a settings object 207 ] 208 }); 209 } 210 var haveModal = $(document).find('#embedModal').length > 0; 211 if (haveModal === false) { 212 var embedDismiss = isBS5() ? 'data-bs-dismiss="modal"' : 'data-dismiss="modal"'; 213 $("body").append('<div class="modal fade am-embed-modal" id="embedModal" tabindex="-1" role="dialog" aria-hidden="true">\n' + 214 ' <div class="modal-dialog" role="document">\n' + 215 ' <div class="modal-content">\n' + 216 ' <div class="modal-header">\n' + 217 ' <button type="button" class="close" ' + embedDismiss + ' aria-label="Close">\n' + 218 ' <span aria-hidden="true">×</span>\n' + 219 ' </button>\n' + 220 ' </div>\n' + 221 ' <div class="modal-body">\n' + 222 ' </div>\n' + 223 ' </div>\n' + 224 ' </div>\n' + 225 '</div>') 226 } 227// $('[data-slick="slider"]').slick({ 228// slidesToShow: 1, 229// slidesToScroll: 1, 230// autoplay: true, 231// autoplaySpeed: 2000 232// }) 233 234 // Remove the form unwanted contents 235 $('form .edit-icon,form .form-name-label,form .image,form .control-icons,form .required-field img,form .drag-drop-rectangle').remove(); 236 navLink(); 237 $(window).resize(function () { 238 navLink(); 239 colorRatio() 240 }) 241 $(document).on('click', '[data-haveModal="true"]', function () { 242 var modalContent = $(this).find(".tempFrameNone").html(); 243 var modalWidth = $(this).attr('data-embedWidth'); 244 modalWidth && $(".am-embed-modal .modal-dialog").css('width', '' + modalWidth + 'px'); 245 var licenseNumber = localStorage.getItem('licenseNumber'); 246 var haveEpro = $(this).closest('section [data-eprolink]').length > 0; 247 $(this).closest('[data-eprolink]').attr('data-eprolink', licenseNumber); 248 var eproKey = $(this).closest('[data-eprolink]').attr('data-eprolink'); 249 var src = $(this).find(".tempFrameNone iframe").attr('src'); 250 var sourceLink = src; 251 src = src && src.split("?")[0]; 252 var parameters = sourceLink.split("?")[1].split('&'); 253 var anotherParams = ''; 254 if (parameters.length > 0) { 255 parameters.map(function (data) { 256 if (data.includes("license_no") === false) { 257 anotherParams += '&' + data + ''; 258 } 259 }) 260 } 261 262 if (eproKey) { 263 //"?license_no is kept statically, if the URL param changes, we have to consider this" 264 var videoSrc = eproKey && src.concat('?license_no=' + eproKey + ''); 265 anotherParams ? videoSrc = videoSrc.concat(anotherParams) : ""; 266 $(this).find(".tempFrameNone iframe").attr('src', videoSrc); 267 var currentContent = $(this).find(".tempFrameNone").html(); 268 modalContent = currentContent; 269 $(this).find(".tempFrameNone iframe").attr('src', src); 270 } 271 $('#embedModal .modal-body').html(modalContent); 272 showEmbedModal(); 273 modalWidth && $(".am-embed-modal .modal-dialog").css({ 274 'max-width': '' + modalWidth + 'px', 275 'width': '' + modalWidth + 'px' 276 }); 277 haveEpro ? $(".am-embed-modal .modal-body iframe").css('min-height', 'calc(100vh - 100px)') : ""; 278 279 }) 280 281 $('[data-inline-link][data-href]').on('click', function () { 282 window.open($(this).attr("data-href"), $(this).attr("data-target")); 283 }) 284 285 $('.am-nav-drop .am-dropdown').hover( 286 function () { 287 if (window.matchMedia('(min-width: 768px)').matches) { 288 $('body').css('overflow', 'hidden'); 289 $('html').css('scrollbar-gutter', 'stable'); 290 // Disable scroll 291 } 292 }, 293 function () { 294 if (window.matchMedia('(min-width: 768px)').matches) { 295 $('body').css('overflow', ''); // Restore scroll 296 $('html').css('scrollbar-gutter', 'auto'); 297 298 } 299 } 300 ); 301}) 302 303function processSchemaData() { 304 var schemaData = document.getElementById('siteSchemaData'); 305 if (schemaData && schemaData.value) { 306 var schemaElement = document.createElement('script'); 307 schemaElement.type = 'application/ld+json'; 308 schemaElement.text = JSON.stringify(JSON.parse(schemaData.value)); 309 document.querySelector('head').appendChild(schemaElement); 310 } 311} 312 313function isBS5() { 314 if (typeof bootstrap.Collapse.getOrCreateInstance === 'function') { 315 return true; 316 } 317 var v = bootstrap.Collapse.VERSION; 318 return typeof v === 'string' && v.charAt(0) === '5'; 319} 320 321function showEmbedModal() { 322 if (isBS5() && typeof bootstrap.Modal !== 'undefined') { 323 var el = document.getElementById('embedModal'); 324 if (el) { 325 bootstrap.Modal.getOrCreateInstance(el).show(); 326 } 327 } else if (typeof $.fn.modal === 'function') { 328 $('#embedModal').modal('show'); 329 } 330} 331 332// SVG logos that only define a viewBox (no width/height attributes) report a
333// normal naturalWidth/naturalHeight, but collapse to 0 rendered width when their 334// wrapping element is sized by flex content (e.g. .am-logo inside .navbar-brand), 335// because browsers use a different, content-based sizing pass there. Raster logos 336// never hit this since they always carry real pixel dimensions. 337function fixDimensionlessSvgLogo() { 338 $(".am-header-content [data-logo] img").each(function () { 339 var img = this; 340 var applySize = function () { 341 if (img.getBoundingClientRect().width > 0) { 342 return; 343 } 344 if (!img.naturalWidth || !img.naturalHeight) { 345 return; 346 } 347 var logoContainer = $(img).closest('[data-logo]'); 348 var targetHeight = parseFloat(logoContainer.css('height')) || logoContainer.height(); 349 if (!targetHeight) { 350 return; 351 } 352 var ratio = img.naturalWidth / img.naturalHeight; 353 $(img).css({height: targetHeight + 'px', width: (targetHeight * ratio) + 'px'}); 354 }; 355 356 if (img.complete) { 357 applySize(); 358 } else { 359 img.addEventListener('load', applySize); 360 } 361 }); 362} 363 364function colorRatio() { 365 var bgColor = $('.am-header-content .navbar ').css('background-color'); 366 if (!bgColor) { 367 return 368 } 369 370 if (bgColor.length === 6 || bgColor.length === 7) { 371 bgColor = hexToRGB(bgColor); 372 } 373 var colors = bgColor && bgColor.replace(/^(rgb|rgba)\(/, '').replace(/\)$/, '').replace(/\s/g, '').split(',') 374 r = colors[0]; 375 g = colors[1]; 376 b = colors[2]; 377 o = colors[3]; 378 var colorRatio = Math.round(((parseInt(r) * 299) + (parseInt(g) * 587) + (parseInt(b) * 114)) / 1000); 379 if (window.matchMedia('(max-width: 991px)').matches) { 380 $("[data-showcompany].am-content-hide").length > 0 ? $(".am-header-content [data-logo] img").css('max-width', '250px') : "" 381 if (colorRatio < 127.5) { 382 if (o && o < 0.5) { 383 $('.am-header-content .navbar-toggler').css('color', '#000000'); 384 $('.am-header-content [data-companyname]').addClass("am-sec-phone-color-dark"); 385 $('.am-header-content [data-target="tag_line"]').addClass("am-sec-phone-color-dark"); 386 $(".am-header-content .am-sec-phone").addClass("am-sec-phone-color-dark"); 387 $(".am-header-content .am-sec-label").addClass("am-sec-phone-color-dark"); 388 389 } else { 390 $('.am-header-content .navbar-toggler').css('color', '#ffffff'); 391 $('.am-header-content [data-companyname]').addClass("am-sec-phone-color-light"); 392 $('.am-header-content [data-target="tag_line"]').addClass("am-sec-phone-color-light"); 393 $(".am-header-content .am-sec-phone").addClass("am-sec-phone-color-light"); 394 $(".am-header-content .am-sec-label").addClass("am-sec-phone-color-light"); 395 } 396 } else { 397 $('.am-header-content .navbar-toggler').css('color', '#000000'); 398 if (window.matchMedia('(max-width: 991px)').matches) { 399 $('.am-header-content [data-companyname]').addClass("am-sec-phone-color-dark"); 400 $('.am-header-content [data-target="tag_line"]').addClass("am-sec-phone-color-dark"); 401 $(".am-header-content .am-sec-phone").addClass("am-sec-phone-color-dark"); 402 $(".am-header-content .am-sec-label").addClass("am-sec-phone-color-dark"); 403 } 404 } 405 } else { 406 $('.am-header-content [data-companyname]').removeClass("am-sec-phone-color-light"); 407 $('.am-header-content [data-companyname]').removeClass("am-sec-phone-color-dark"); 408 $('.am-header-content [data-secphone]a').removeClass("am-sec-phone-color-light"); 409 $('.am-header-content [data-secphone]a').removeClass("am-sec-phone-color-dark"); 410 $('.am-header-content [data-target="tag_line"]').removeClass("am-sec-phone-color-light"); 411 $('.am-header-content [data-target="tag_line"]').removeClass("am-sec-phone-color-dark"); 412 $(".am-header-content .am-sec-phone").removeClass("am-sec-phone-color-light"); 413 $(".am-header-content .am-sec-phone").removeClass("am-sec-phone-color-dark"); 414 $(".am-header-content .am-sec-label").removeClass("am-sec-phone-color-dark"); 415 $(".am-header-content .am-sec-label").removeClass("am-sec-phone-color-light"); 416 } 417} 418 419function hexToRGB(hex) { 420 r = parseInt(hex.slice(1, 3), 16), 421 g = parseInt(hex.slice(3, 5), 16), 422 b = parseInt(hex.slice(5, 7), 16); 423 return "rgb(" + r + ", " + g + ", " + b + ")"; 424} 425 426function navLink() { 427 var ww = $(window).width(); 428 if (ww < 992) { 429 $('body').removeClass('expandedMenu'); 430 //Moving all secondary link , phone and email to website menu 431 if (!$('body').hasClass('collapsedMenu')) { 432 $('body').addClass('collapsedMenu'); 433 var navLinks = $('[data-sec]').detach(); 434 $('.am-primary-menu .navbar-nav').append(navLinks); 435 var target = $('[data-phonesecparent]').detach(); 436 $(".am-responsive-numbers").append(target); 437 } 438 } else { 439 $('.nav-duplicate').remove(); 440 $('body').removeClass('collapsedMenu'); 441 if (!$('body').hasClass('expandedMenu')) { 442 $('body').addClass('expandedMenu'); 443 //To Secondary menu 444 var secondaryItems = $('[data-sec]').detach(); 445 if ($('.am-responsive-numbers').children().length > 0) { 446 var target = $('[data-phonesecparent]').detach(); 447 $('.am-header-sec-contents').append(target); 448 } 449 var secEmail = $('[data-secemail]').detach(); 450 $('.am-sec-email .am-sec-link-content').append(secEmail); 451 $('.am-sec-link').append(secondaryItems); 452 } 453 454 } 455 $('section [data-img-position][data-link-img]').each(function () { 456 var url = $(this).attr('data-link-img'); 457 var isExist = $(this).find('img').parent().attr('href') && $(this).find('img').parent().attr('href').length > 0; 458 if (!isExist) { 459 $(this).find('img').wrap('<a href=' + url + ' target="_self"></a>'); 460 } 461 }) 462 window.accordionSetCount = 1; 463 window.accordionItemCount = 1; 464 var useBs5Accordion = isBS5(); 465 $("[data-accordion-set]").each(function () { 466 $(this).attr('id', 'accordionSet' + (accordionSetCount) + ''); 467 $(this).find('[data-accordion="parent"]').each(function () {
468 var delay = $(this).attr('data-wow-delay') 469 var animation = $(this).attr('data-animation') 470 var style = $(this).attr('style'); 471 var calssList = '' 472 if(animation){ 473 calssList = animation + ' wow' 474 } 475 var setParentRef = '#accordionSet' + (accordionSetCount); 476 var itemRef = '#accordionItem' + (accordionItemCount); 477 var contentAttrs = { 'id': 'accordionItem' + (accordionItemCount) }; 478 var linkAttrs; 479 if (useBs5Accordion) { 480 contentAttrs['data-bs-parent'] = setParentRef; 481 linkAttrs = { 'data-bs-target': itemRef, 'data-bs-toggle': 'collapse' }; 482 } else { 483 contentAttrs['data-parent'] = setParentRef; 484 linkAttrs = { 'data-target': itemRef, 'data-toggle': 'collapse' }; 485 } 486 $(this).find(' [data-accordion="content"]').attr(contentAttrs); 487 $(this).find(' [data-accordion="link"]').attr(linkAttrs); 488 var cardTitle = $(this).find(' [data-accordion="link"]').html(); 489 var cardContent = $(this).find(' [data-accordion="content"]').html(); 490 var btnToggleAttrs = useBs5Accordion 491 ? 'data-bs-toggle="collapse" data-bs-target="' + itemRef + '"' 492 : 'data-toggle="collapse" data-target="' + itemRef + '"'; 493 var collapseParentAttr = useBs5Accordion 494 ? 'data-bs-parent="' + setParentRef + '"' 495 : 'data-parent="' + setParentRef + '"'; 496 var accordionCard='<div class="card '+calssList+'" data-accordion="parent" data-wow-delay="'+delay+'" data-animation="'+animation+'" style="'+style+'" >' + 497 '<div class="card-header" id="accordionHeader' + accordionItemCount + '">' + 498 '<h2 class="mb-0">' + 499 '<button class="btn btn-light btn-block text-left" type="button" data-accordion="link" data-element="text" data-edit="text" ' + btnToggleAttrs + '">' + cardTitle + '</button>' + 500 '</h2>' + 501 '</div>' + 502 '<div class="collapse" id="accordionItem' + accordionItemCount + '" aria-labelledby="accordionHeader' + accordionItemCount + '" ' + collapseParentAttr + '">' + 503 '<div class="card-body" data-accordion="content" data-element="text" data-edit="text" >' + cardContent + '</div></div>' + 504 '</div>' 505 $(this).replaceWith(accordionCard); 506 accordionItemCount++; 507 }) 508 $('#accordionSet' + accordionSetCount + '>div:nth-child(1)').find('[data-accordion="content"]').addClass('show') 509 accordionSetCount++; 510 }) 511 512 //to remove the a tag which is inserted in text editor without text ( with prevously selected link in the linkpopup) 513 $('section[data-component] [data-element="text"] a').each(function () { 514 var htmlLen = $(this).html(); 515 if (!htmlLen) { 516 $(this).remove(); 517 } 518 }) 519 520 $('section[data-component] [data-element="blog"] a').each(function () { 521 var htmlLen = $(this).html(); 522 if (!htmlLen) { 523 $(this).remove(); 524 } 525 }) 526 //to fix the overflow issue in the dropdown 527 var containerWidth = $('.am-primary-menu .container').innerWidth(); 528 var dropDownWidth = 200; 529 containerWidth = containerWidth - dropDownWidth; 530 $("header .navbar-nav>div").each(function () { 531 var totalPosition = 0; 532 var elementPosition = $(this).position(); 533 var elementWidth = $(this).outerWidth(); 534 totalPosition = elementWidth + elementPosition.left; 535 var actualValue = totalPosition; 536 if (actualValue > containerWidth) { 537 $(this).find('.am-dropdown').css({'right': '0', 'left': 'unset'}) 538 } 539 }) 540 $('[data-edit="star"] .fa-star-o').remove(); 541 542 $("[data-navlink-id].nav-link").on("click", function(e) { 543 if ($(this).next().hasClass('am-content-hide')) { 544 return true; 545 } else { 546 $('.nav-duplicate').remove(); 547 if ("ontouchstart" in document.documentElement) { 548 if ($(this).next("[data-sub-navlink]").length > 0 && $(this).next("[data-sub-navlink]").children().length > 0) { 549 e.preventDefault(); 550 let lin = $(this).attr('href'); 551 let tex = $(this).text(); 552 $(this).next().prepend('<a class="nav-item nav-link nav-duplicate" href="' + lin + '">' + tex + '</a>') 553 } 554 } 555 } 556 }) 557 558} 559 560// Script for navigation bar 561$(window).resize(function () { 562 navMenuMobile(); 563 var windowWidth = $(window).width(); 564 if (windowWidth > 991) { 565 $("[data-navlink-id]").removeClass("am-landing-mobile-event"); 566 $("[data-navlink-id]").next().css({ 567 "position": "", 568 "display": "", 569 "transform": "" 570 }); 571 $('.nav-duplicate').remove(); 572 } else { 573 $("[data-navlink-id]").addClass("am-landing-mobile-event"); 574 } 575}) 576 577function navMenuMobile() { 578 var windowWidth = $(window).width(); 579 580 if (windowWidth > 991) { 581 $("[data-navlink-id]").removeClass("am-landing-mobile-event"); 582 } else { 583 $("[data-navlink-id]").each(function () { 584 let a = $(this).attr('data-navlink-id'); 585 let b = $('[data-sub-navlink="' + a + '"]').hasClass('am-content-hide'); 586 if (!b) { 587 $(this).addClass("am-landing-mobile-event"); 588 } 589 }) 590 } 591 592 $("#navbarNavAltMarkup .am-nav-drop").each(function () { 593 var a = $(this).find("[data-showdropdownmenu] > *").length; 594 if ((a > 0) && (windowWidth < 991) && !($('[data-showdropdownmenu]').hasClass('am-content-hide'))) { 595 let iconLength = $(this).find('.mobile-icon').length; 596 if (iconLength < 1) { 597 var b = $(this).find('[data-navlink-id]'); 598 b.append('<i class="fa fa-caret-down mobile-icon" style="margin-left: 10px;" aria-hidden="true" ></i>') 599 } 600 } else { 601 $(this).find(".mobile-icon").remove(); 602 } 603 }) 604 605} 606 607 608$(document).on("click", "[data-navlink-id].am-landing-mobile-event", function (e) { 609 if ($(this).next().hasClass('am-content-hide')) { 610 return true; 611 } else { 612 if($(this).next("[data-sub-navlink]").children().length > 0) { 613 e.preventDefault(); 614 $('[data-showdropdownmenu]').css({ 615 "position": "", 616 "display": "", 617 "transform": "" 618 }); 619 $('.nav-duplicate').remove(); 620 if ($(this).hasClass("nv-active")) { 621 $(this).removeClass("nv-active"); 622 $('.nav-duplicate').remove(); 623 $(this).next().css({ 624 "position": "", 625 "display": "", 626 "transform": "" 627 }); 628 } else { 629 $("[data-navlink-id]").removeClass('nv-active'); 630 $(this).addClass('nv-active') 631 let lin = $(this).attr('href'); 632 let tex = $(this).text(); 633 $(this).next().prepend('<a class="nav-item nav-link nav-duplicate" href="' + lin + '">' + tex + '</a>') 634 $(this).next().css({ 635 "position": "static", 636 "display": "block", 637 "width": "100%", 638 "transform": "scaleY(1)" 639 }) 640 } 641 } 642 } 643}) 644$(window).on('scroll', function () { 645 if ($('[position-sticky]')) { 646 var windowTop = $(window).scrollTop(); 647 if (windowTop > 10) { 648 $('[position-sticky]').addClass('sticked'); 649 } else { 650 $('[position-sticky]').removeClass('sticked'); 651 } 652 } 653}) 654$(window).on('load', function () { 655 navMenuMobile(); 656}) 657 658$(document).ready(function() { 659 // This function calculates and sets the height 660 function adjustElementHeight() { 661 var element = $('.am-nav-drop'); 662 663 // Ensure the element exists before proceeding 664 if (element.length) { 665 // Only run the script for viewports 1024px and wider 666 if ($(window).width() >= 1024) { 667 // Get the distance from the top of the document to the top of the container 668 var offsetTop = element.offset().top; 669 670 // Get the height of the browser viewport 671 var windowHeight = $(window).height(); 672 673 // Calculate the remaining height 674 // We subtract 150px for bottom padding/margin 675 var remainingHeight = windowHeight - offsetTop - 150; 676 677 // Set the inner dropdown's height 678 // We only apply the height if it's a positive value 679 if (remainingHeight > 0) { 680 element.find('.am-dropdown').css('max-height', remainingHeight + 'px'); 681 } 682 } else { 683 // If the screen is smaller than 1024px, reset the height to allow it to be auto 684 element.find('.am-dropdown').css('max-height', ''); 685 } 686 } 687 } 688 689 // Call the function on page load 690 adjustElementHeight(); 691 692 // Recalculate on window resize to make it responsive 693 $(window).on('resize', function() { 694 adjustElementHeight(); 695 }); 696}); 697 698$(document).on('click', '[data-component="link-card"] a[data-target="am-button"]', function (e) { 699 e.preventDefault(); 700 return false;
701 });
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.