1'use strict'; 2 3/** 4 * @file basic-page.js 5 */ 6(function ($, Drupal, once) { 7 'use strict'; 8 9 Drupal.behaviors.clientThemeBasicPageJS = { 10 attach: function attach(context, settings) { 11 12 // Exit if basic page content type doesn't exist 13 if (!$('body.page-node-type-page').length) { 14 return false; 15 } 16 17 var setupPageSlideshow = function setupPageSlideshow() { 18 // Set layout location in slider 19 $('.layout__region--slideshow').each(function () { 20 // Sets up slider class slideshow_location 21 var slideLocation = $(this).find('.field--name-field-content-location').text(); 22 slideLocation = slideLocation.toLowerCase().trim(); 23 slideLocation = slideLocation.replace(/\s/g, ''); 24 25 $(this).find('.slider-text-container').addClass(slideLocation); 26 }); 27 28 // Find Slider 29 var slider = $('.layout--paragraph_slideshow_wrapper').find('.field--name-field-slide'); 30 31 // Init Slider 32 $(slider).slick({ 33 arrows: false, 34 dots: true, 35 infinite: true, 36 slidesToShow: 1, 37 slidesToScroll: 1, 38 useCSS: false, 39 useTransform: false, 40 variableWidth: false 41 }).addClass('active-slideshow'); 42 }; 43 44 var contactFormMove = function contactFormMove() { 45 $('.layout__region--column_one .col6').append($('.paragraph--type--webform')); 46 }; 47 48 // Init Basic Page 49 $(document).ready(function () { 50 once('setup-basic-page', 'body.page-node-type-page').forEach(function (element) { 51 setupPageSlideshow(element); 52 53 if (element.classList.contains('page-node-11')) { 54 contactFormMove(element); 55 } 56 }); 57 }); 58 } 59 }; 60})(jQuery, Drupal, once); 61'use strict'; 62 63/** 64 * @file center-text-with-image.js 65 */ 66 67(function ($, Drupal, once) { 68 'use strict'; 69 70 Drupal.behaviors.clientThemeCenterTextJS = { 71 72 attach: function attach(context, settings) { 73 74 $(document).ready(function () { 75 once('setup-two-column-paragraph', '.layout--paragraph_two_column').forEach(function (element) { 76 centerText(element, $); 77 78 $(window).resize(function () { 79 centerText(element, $); 80 }); 81 }); 82 }); 83 } 84 85 }; 86})(jQuery, Drupal, once); 87'use strict'; 88 89/** 90 * @file default.js 91 */ 92(function ($) { 93 'use strict'; 94 95 Drupal.behaviors.clientThemeDefaultJS = { 96 attach: function attach(context, settings) { 97 98 var applyMessagesClickEvents = function applyMessagesClickEvents() { 99 if ($('.messages__wrapper').length) { 100 101 // Set the cursor to pointer 102 $('.messages__wrapper').css('cursor', 'pointer'); 103 104 // Close the messages box on click 105 $('.messages__wrapper').click(function (ev) { 106 ev.preventDefault(); 107 $('.messages__wrapper').fadeOut().remove(); 108 }); 109 } 110 }; 111 112 var addIE11Class = function addIE11Class(that) { 113 // Sets class to site if ie11 114 115 if (isBrowser(that, ['IE11'])) { 116 $('body').addClass('ie11'); 117 } 118 }; 119 120 if (!String.prototype.includes) { 121 String.prototype.includes = function (search, start) { 122 if (typeof start !== 'number') { 123 start = 0; 124 } 125 126 if (start + search.length > this.length) { 127 return false; 128 } else { 129 return this.indexOf(search, start) !== -1; 130 } 131 }; 132 } 133 134 $(document).ready(function () { 135 136 once('default-setup', 'body').forEach(function (element) { 137 addIE11Class($); 138 139 $(element).find('.messages__wrapper').each(function () { 140 applyMessagesClickEvents(); 141 }); 142 }); 143 }); 144 } 145 }; 146})(jQuery); 147'use strict'; 148 149/** 150 * @file footer.js 151 */ 152(function ($) { 153 'use strict'; 154 155 Drupal.behaviors.clientThemeFooterJS = { 156 attach: function attach(context, settings) { 157 158 var mobileFooterSort = function mobileFooterSort() { 159 $('footer.main').each(function () { 160 var subfooterWrapper = $(this).find('.col12'); 161 var mainsubFooterMenu = $(this).find('.col12 > div'); 162 var mainsubFooterCopy = $(this).find('.copyright-footer'); 163 mainsubFooterMenu.addClass('subfooter-menu-wrapper'); 164 mainsubFooterMenu = $('.subfooter-menu-wrapper'); 165 166 if ($(window).width() < 768) { 167 mainsubFooterMenu.insertBefore(mainsubFooterCopy); 168 } else { 169 mainsubFooterCopy.insertBefore(mainsubFooterMenu); 170 } 171 }); 172 }; 173 174 mobileFooterSort(); 175 176 $(window).resize(function () { 177 mobileFooterSort(); 178 }); 179 } 180 }; 181})(jQuery); 182'use strict'; 183 184/** 185 * @file forms.js 186 */ 187(function ($) { 188 'use strict'; 189 190 Drupal.behaviors.clientThemeFormsJS = { 191 attach: function attach(context, settings) { 192 193 var setupRequiredForms = function setupRequiredForms() { 194 $('.paragraph--type--webform form input[required="required"], .paragraph--type--webform form textarea[required="required"]').each(function () { 195 var requiredText = typeof $(this).attr('placeholder') !== "undefined" ? $(this).attr('placeholder') : 'Required'; 196 $(this).attr('placeholder', requiredText + ' *'); 197 }); 198 }; 199 200 $(document).ready(function () { 201 once('required-form-setup', '.paragraph--type--webform').forEach(function (element) { 202 setupRequiredForms(element); 203 }); 204 }); 205 } 206 }; 207})(jQuery); 208'use strict'; 209 210/** 211 * @file gmaps.js 212 */ 213(function ($) { 214 'use strict'; 215 216 Drupal.behaviors.clientThemeGmapsJS = { 217 attach: function attach(context, settings) { 218 219 if (!$('.layout--map_component').length) { 220 return false;
221 } 222 //Gmap Components 223 224 var googleMap = function googleMap() { 225 var latitude = $(); 226 var longitude = $(); 227 var maptitle = $(); 228 var mapcontent = $(); 229 230 var bittersMap = function () { 231 var myLatlng = new google.maps.LatLng(latitude, longitude), 232 mapCenter = new google.maps.LatLng(latitude, longitude), 233 mapCanvas = document.getElementById('map_canvas'), 234 mapOptions = { 235 center: mapCenter, 236 zoom: 13, 237 scrollwheel: false, 238 draggable: true, 239 disableDefaultUI: true, 240 mapTypeId: google.maps.MapTypeId.ROADMAP 241 }, 242 map = new google.maps.Map(mapCanvas, mapOptions), 243 contentString = '<div id="content">' + '<div id="siteNotice">' + '</div>' + '<h1 id="firstHeading" class="firstHeading">' + maptitle + '</h1>' + '<div id="bodyContent"' + '<p>' + mapcontent + '</p>' + '</div>' + '</div>', 244 infowindow = new google.maps.InfoWindow({ 245 content: contentString, 246 maxWidth: 300 247 }), 248 marker = new google.maps.Marker({ 249 position: myLatlng, 250 map: map, 251 title: maptitle 252 }); 253 254 return { 255 init: function init() { 256 map.set('styles', [{ 257 featureType: 'landscape', 258 elementType: 'geometry', 259 stylers: [{ hue: '#ffff00' }, { saturation: 30 }, { lightness: 10 }] 260 }]); 261 262 google.maps.event.addListener(marker, 'click', function () { 263 infowindow.open(map, marker); 264 }); 265 } 266 }; 267 }(); 268 269 // look for lat or long on page if not there exit 270 if ($(lat).length || $(log).length) { 271 bittersMap.init(); 272 } else { 273 return false; 274 } 275 }; 276 277 $(document).ready(function () { 278 googleMap(); 279 }); 280 } 281 }; 282})(jQuery); 283'use strict'; 284 285/** 286 * @file horizontal-tabs.js 287 */ 288(function ($, Drupal, once) { 289 'use strict'; 290 291 Drupal.behaviors.clientThemeHorizontalTabsJS = { 292 attach: function attach(context, settings) { 293 294 // Exit if tabs don't exist 295 if (!$(".accordion-tabs").length) { 296 return false; 297 } 298 299 // Horizontal accordion Tabs 300 var accordionTabs = function accordionTabs() { 301 302 // Sets up 303 $('.accordion-tabs').each(function (index) { 304 $(this).children('li').first().children('a').addClass('is-active').next().addClass('is-open').show(); 305 }); 306 307 // Horizontal accordion Tabs click event watch 308 $('.accordion-tabs').on('click', 'li > a.tab-link', function (event) { 309 310 if (!$(this).hasClass('is-active')) { 311 event.preventDefault(); 312 var accordionTabs = $(this).closest('.accordion-tabs'); 313 accordionTabs.find('.is-open').removeClass('is-open').hide(); 314 315 $(this).next().toggleClass('is-open').toggle(); 316 accordionTabs.find('.is-active').removeClass('is-active'); 317 $(this).addClass('is-active'); 318 } else { 319 event.preventDefault(); 320 } 321 }); 322 }; 323 324 // Init Accordion Tabs 325 $(document).ready(function () { 326 once('accordion-init', '.accordion-tabs').forEach(function (element) { 327 accordionTabs(element); 328 }); 329 }); 330 } 331 }; 332})(jQuery, Drupal, once); 333"use strict"; 334 335/** 336 * @file modal.js 337 */ 338(function ($, Drupal, once) { 339 'use strict'; 340 341 Drupal.behaviors.clientThemeModalJS = { 342 attach: function attach(context, settings) { 343 344 // Exit if modal doesn't exist 345 if (!$("#modal-1").length) { 346 return false; 347 } 348 349 // Click function for Modal 350 var modalControl = function modalControl() { 351 352 // Event listener for click event to open modal 353 $("#modal-1").on("change", function () { 354 if ($(this).is(":checked")) { 355 $("body").addClass("modal-open"); 356 } else { 357 $("body").removeClass("modal-open"); 358 } 359 }); 360 361 // Event listener for click event to close modal
362 $(".modal-fade-screen, .modal-close").on("click", function () { 363 $(".modal-state:checked").prop("checked", false).change(); 364 }); 365 366 $(".modal-inner").on("click", function (e) { 367 e.stopPropagation(); 368 }); 369 }; 370 371 // Init modalControl 372 $(document).ready(function () { 373 once('modal-init', '#modal-1').forEach(function (element) { 374 modalControl(element); 375 }); 376 }); 377 } 378 }; 379})(jQuery, Drupal, once); 380'use strict'; 381 382/** 383 * @file move-h2s.js 384 */ 385(function ($, Drupal, once) { 386 'use strict'; 387 388 Drupal.behaviors.clientThemeMoveH2sJS = { 389 attach: function attach(context, settings) { 390 391 // get all rows that contain a large image 392 var rowsWithImage = $('.field__item .layout').toArray().filter(function (el) { 393 var image = $(el).find('img'); 394 if (image.length) { 395 if (image[0].height > 100) { 396 return el; 397 } 398 } 399 }); 400 401 // get h2s for each rows â these will change position depending on the screen width 402 var h2s = rowsWithImage.map(function (el) { 403 return $(el).find('h2')[0]; 404 }); 405 406 // get images in the rows - the h2 will be above the image at smaller screen widths 407 var images = rowsWithImage.map(function (el) { 408 var image = $(el).find('img')[0]; 409 if (image.height > 100) { 410 return image; 411 } 412 }); 413 414 // get all text paragraphs in the right-hand columns of those rows 415 // the h2 will move back to being above the first element in that column at larger screen widths 416 var paragraphs = rowsWithImage.map(function (el) { 417 return $(el).find('.col6')[1]; 418 }).map(function (col) { 419 return $(col).find('*')[0]; 420 }); 421 422 // number of rows 423 var length = rowsWithImage.length; 424 425 // change formatting depending on screen width 426 427 enquire.register('screen and (max-width: 768px)', { 428 429 // if the screen is below 768px, move h2 above image 430 // if the screen expands outwards again, move it back to the right-hand column 431 match: function match() { 432 for (var i = 0; i < length; i++) { 433 $(images[i]).parent().prepend(h2s[i]); 434 } 435 }, 436 unmatch: function unmatch() { 437 for (var i = 0; i < length; i++) { 438 $(paragraphs[i]).prepend(h2s[i]); 439 } 440 } 441 }); 442 } 443 }; 444})(jQuery, Drupal, once); 445'use strict'; 446 447/** 448 * @file mutationobs.js 449 */ 450(function ($, once) { 451 'use strict'; 452 453 Drupal.behaviors.clientThemeMutationObserverJS = { 454 attach: function attach(context, settings) { 455 456 var mutationobs = function mutationobs() { 457 MutationObserver = window.MutationObserver || window.WebKitMutationObserver; 458 459 // define a new observer 460 var obs = new MutationObserver(function (mutations, observer) { 461 adjustMenuSpacer($); 462 }); 463 464 // have the observer observe the body for changes in children 465 obs.observe($('body').get(0), { 466 attributes: true 467 }); 468 }; 469 470 $(document).ready(function () { 471 adjustMenuSpacer($); 472 473 once('init', window).forEach(function (element) { 474 mutationobs(element); 475 }); 476 477 $(window).resize(function () { 478 adjustMenuSpacer($); 479 // mutationobs(); 480 }); 481 }); 482 } 483 }; 484})(jQuery, once); 485'use strict'; 486 487/** 488 * @file open-external-links.js 489 */ 490 491(function ($, Drupal, once) { 492 'use strict'; 493 494 Drupal.behaviors.clientThemeOpenExternalLinkswJS = { 495 attach: function attach(context, settings) { 496 497 var scanLinks = function scanLinks() { 498 // All links on a given page 499 var allLinks = $('.region-content a').toArray(); 500 501 var containsSiteURL = function containsSiteURL(link, siteURLs) { 502 return siteURLs.map(function (url) { 503 return link.includes(url) ? true : false; 504 }).filter(function (el) { 505 return el; 506 }).length ? false : true; 507 }; 508 509 var isFileType = function isFileType(link, fileTypes) { 510 return fileTypes.map(function (el) { 511 return link.includes(el) ? true : false;
512 }).filter(function (el) { 513 return el; 514 }).length ? true : false; 515 }; 516 517 allLinks.forEach(function (link) { 518 // Any links to these URLs should NOT open in a new tab 519 var siteURLs = ['portlandjetport.test/', 'pwm-stage.rinck.io/', 'portlandjetport.org/', 'www.portlandjetport.org/']; 520 521 // Any PDFs SHOULD open in a new tab 522 var fileTypes = ['files/pdf', 'files/doc', 'files/excel']; 523 524 // Test to see if link contains site URL or if link is a relative path or anchor link 525 // If it doesn't fulfill any of those, apply target blank so it opens in a new window/tab 526 if (link.href !== '' && link.href[0] !== '#' && link.href[0] !== '/' && !link.href.substr(0, 4) === 'tel:' && !link.href.includes('mailto') && (containsSiteURL(link.href, siteURLs) || isFileType(link.href, fileTypes))) { 527 $(link).attr({ 528 target: '_blank', 529 rel: 'nofollow' 530 }).addClass('external-link'); 531 532 $(link).html($(link).html() + ' ').append($('<i/>').addClass('far fa-external-link-alt')); 533 } 534 }); 535 }; 536 537 once('scan-external-links', 'body').forEach(function (element) { 538 scanLinks(element); 539 }); 540 } 541 }; 542})(jQuery, Drupal, once); 543'use strict'; 544 545var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; 546 547/** 548 * @file tabs.js 549 */ 550(function ($, Drupal, once) { 551 'use strict'; 552 553 Drupal.behaviors.clientThemeTabsJS = { 554 attach: function attach(context, settings) { 555 556 /** 557 * Returns an object that contains both the active and inactive tab height 558 * for a container 559 * @method getTabHeights 560 * @param {object} $ Object reference 561 * @param {[type]} el Object reference 562 * @return {[type]} Object that contains 'active' and 'inactive' 563 * heights 564 */ 565 var getTabHeights = function getTabHeights($, el) { 566 var parentPadding = sanitizeCssHeight(el.css('padding-top')) + sanitizeCssHeight(el.css('padding-bottom')); 567 var titleRowHeight = sanitizeCssHeight(el.find('.layout__region--title_row').css('height')); 568 var copyRowHeight = sanitizeCssHeight(el.find('.layout__region--copy_row').css('height')); 569 570 return { 571 active: titleRowHeight + copyRowHeight + parentPadding, 572 inactive: titleRowHeight + parentPadding 573 }; 574 }; 575 576 /** 577 * Resets the page tab heights. This runs on load and on window resize. 578 * @method resetPageTabs 579 */ 580 var resetPageTabs = function resetPageTabs() { 581 $('.layout--tab_component').each(function () { 582 var tabHeights = getTabHeights($, $(this)); 583 $(this).css('height', ($(this).hasClass('active') ? tabHeights.active : tabHeights.inactive) + 'px'); 584 }); 585 }; 586 587 // sets first tab class for tab list 588 var setupTabInitOpen = function setupTabInitOpen() { 589 var firsttab = $('.field--name-field-body > .field__item > .paragraph--type--page-tab').first(); 590 firsttab.parent().addClass('first-tab'); 591 var tabParent = $(firsttab).find('.layout--tab_component'); 592 var tabIcon = $(tabParent).find('.tab-toggle'); 593 var tabHeights = getTabHeights($, tabParent); 594 595 $('.layout--tab_component').removeClass('active'); 596 resetPageTabs(); 597 //scrollTo($, $(tabParent), 500); 598 $(tabParent).addClass('active').animate({ 599 height: tabHeights.active 600 }, 500); 601 602 if (tabIcon.hasClass('fa-plus-circle') && tabParent.hasClass('active')) { 603 tabIcon.removeClass('fa-plus-circle').addClass('fa-minus-circle'); 604 } else { 605 tabIcon.removeClass('fa-minus-circle').addClass('fa-plus-circle'); 606 } 607 }; 608 609 /** 610 * Sets up the tab click action handler 611 * @method 612 * @return {null} 613 */ 614 // var setupTabClickActions = function setupTabClickActions() { 615 // $('.layout__region--title_row').click(function () { 616 // var tabParent = $(this).parent().parent(); 617 // var tabIcon = $(this).find('i'); 618 // var tabHeights = getTabHeights($, tabParent); 619 // var parkingviewparent = $('.field--name-field-one-column-view').parent().parent().parent().parent(); 620 // $('.layout__region--title_row').find('i').removeClass('fa-minus-circle').addClass('fa-plus-circle'); 621 622 // if (tabParent.hasClass('active')) { 623 // tabParent.removeClass('active').animate({ 624 // height: tabHeights.inactive 625 // }, 500); 626 // } else { 627 // $('.layout--tab_component').removeClass('active'); 628 // resetPageTabs(); 629 // scrollTo($, $(this), 500); 630 // tabParent.addClass('active').animate({ 631 // height: tabHeights.active 632 // }, 500); 633 // } 634 // if (tabIcon.hasClass('fa-plus-circle') && tabParent.hasClass('active')) { 635 // tabIcon.removeClass('fa-plus-circle').addClass('fa-minus-circle'); 636 // } else { 637 // tabIcon.removeClass('fa-minus-circle').addClass('fa-plus-circle'); 638 // } 639 // }); 640 // }; 641 var setupTabClickActions = function setupTabClickActions() { 642 $('.layout__region--title_row').click(function () { 643 var tabParent = $(this).parent().parent(); 644 var tabIcon = $(this).find('i'); 645 var tabHeights = getTabHeights($, tabParent); 646 647 // This line ensures that clicking another tab doesn't close all others 648 // $('.layout__region--title_row').find('i').removeClass('fa-minus-circle').addClass('fa-plus-circle'); 649 650 // Toggle the active state of the clicked tab without affecting others 651 if (tabParent.hasClass('active')) { 652 tabParent.removeClass('active').animate({ 653 height: tabHeights.inactive 654 }, 500); 655 tabIcon.removeClass('fa-minus-circle').addClass('fa-plus-circle'); 656 } else { 657 // No need to reset other tabs to their inactive state here 658 scrollTo($, $(this), 500); // Consider if you still need this as it might disrupt user experience 659 tabParent.addClass('active').animate({ 660 height: tabHeights.active 661 }, 500); 662 tabIcon.removeClass('fa-plus-circle').addClass('fa-minus-circle'); 663 } 664 }); 665 }; 666 667 668 /** 669 * Loop through all tabs and add a class to each last tab in each group. 670 * 671 * Example structure 672 * [paragraph] 673 * [tab] 674 * [tab] - last-tab 675 * [paragraph] 676 * [tab] - last-tab 677 * 678 * @method 679 * @return {[type]} [description] 680 */ 681 var findLastTabInEachGroup = function findLastTabInEachGroup() {
682 var tabObj = void 0; 683 684 $('.field--name-field-body > .field__item').each(function () { 685 if ($(this).find('.paragraph--type--page-tab').length) { 686 tabObj = $(this); 687 } else { 688 if ((typeof tabObj === 'undefined' ? 'undefined' : _typeof(tabObj)) === 'object') { 689 tabObj.addClass('last-tab'); 690 tabObj = null; 691 } 692 } 693 }); 694 695 // Clean up if the tab was the last thing scanned. 696 if ((typeof tabObj === 'undefined' ? 'undefined' : _typeof(tabObj)) === 'object' && tabObj !== null) { 697 tabObj.addClass('last-tab'); 698 tabObj = null; 699 } 700 }; 701 702 $(document).ready(function () { 703 once('setup-tab-sections', '.region-content').forEach(function (element) { 704 resetPageTabs(element); 705 setTimeout(function () { 706 resetPageTabs(element); 707 }, 1000); 708 setupTabClickActions(element); 709 findLastTabInEachGroup(element); 710 setupTabInitOpen(element); 711 712 $(window).resize(function () { 713 resetPageTabs(element); 714 }); 715 }); 716 }); 717 } 718 }; 719})(jQuery, Drupal, once); 720'use strict'; 721 722/** 723 * @file alerts.js 724 */ 725(function ($) { 726 'use strict'; 727 728 Drupal.behaviors.clientThemeContentTypeAlertsJS = { 729 attach: function attach(context, settings) { 730 731 // Quick exit if the node is not of the 'news' content type 732 if (!$('#block-views-block-alerts-block-1').length) { 733 return false; 734 } 735 736 // since there is an alert remove the hidden class from section 737 $('.alert-area').removeClass('hidden'); 738 739 // Moves the global title before the publish date 740 var moveAlertTitle = function moveAlertTitle() { 741 $('#block-views-block-alerts-block-1 .views-row').each(function () { 742 var titlerow = $(this).find('.alert-title-row'); 743 var title = $(this).find('header'); 744 745 // Shuts off the header link 746 title.find('a').click(function (ev) { 747 ev.preventDefault(); 748 }); 749 750 // Appends title to proper area 751 titlerow.append(title); 752 }); 753 }; 754 755 // Click toggle for Alert 756 var alertTabToggle = function alertTabToggle() { 757 $('#block-views-block-alerts-block-1 .views-row').each(function () { 758 var that = $(this); 759 760 $(this).find('.tab-toggle').click(function () { 761 $(this).find('.tab-toggle').removeClass('fa-plus-circle').addClass('fa-minus-circle'); 762 that.find('.alert-copy-row').toggleClass('hidden'); 763 764 // Runs menu height adjuster on button click 765 if ($(this).hasClass('fa-minus-circle') && that.find('.alert-copy-row').hasClass('hidden')) { 766 $(this).removeClass('fa-minus-circle').addClass('fa-plus-circle'); 767 } else { 768 $(this).removeClass('fa-plus-circle').addClass('fa-minus-circle'); 769 } 770 771 adjustMenuSpacer($); 772 }); 773 }); 774 }; 775 776 $(document).ready(function () { 777 once('setup-page-alerts', '#block-views-block-alerts-block-1').forEach(function (element) { 778 moveAlertTitle(element); 779 alertTabToggle(element); 780 }); 781 }); 782 } 783 }; 784})(jQuery); 785'use strict'; 786 787/** 788 * @file news.js 789 */ 790(function ($) { 791 'use strict'; 792 793 Drupal.behaviors.clientThemeContentTypeNewsJS = { 794 attach: function attach(context, settings) { 795 796 // Quick exit if the node is not of the 'news' content type 797 if (!$('.page-node-type-news').length) { 798 return false; 799 } 800 801 // Moves the global title before the publish date 802 var movePageTitle = function movePageTitle() { 803 804 // Build Article Title section 805 var articleH4Container = $('<h3>').addClass('article-title').text($('.page-title span').text()); 806 807 // Append the title to the container 808 articleH4Container.insertBefore($('.field--name-field-published-date')); 809 }; 810 811 $(document).ready(function () { 812 once('setup-news-content-type', '.page-node-type-news').forEach(function (element) { 813 movePageTitle(element); 814 }); 815 }); 816 } 817 }; 818})(jQuery); 819'use strict'; 820 821/** 822 * @file gtranslate.js 823 */ 824(function ($, Drupal, once) { 825 'use strict'; 826 827 Drupal.behaviors.clientThemeFeatureGoogleTranslateJS = { 828 attach: function attach(context, settings) { 829 830 if (!$('#block-gtranslate').length) { 831 return false;
832 } 833 834 var setupGtranslate = function setupGtranslate() { 835 once('setup-gtranslate', '#block-gtranslate').forEach(function (element) { 836 var translatelist = $(element).find('select'); 837 838 translatelist.select2({ 839 minimumResultsForSearch: -1 840 }); 841 }); 842 }; 843 844 $(document).ready(function () { 845 once('setup-translations', '#block-gtranslate').forEach(function (element) { 846 setupGtranslate(element); 847 }); 848 }); 849 } 850 }; 851})(jQuery, Drupal, once); 852'use strict'; 853 854/** 855 * @file news-sidebar-category-dropdown.js 856 */ 857(function ($, Drupal, once) { 858 'use strict'; 859 860 Drupal.behaviors.clientThemeNewsSidebarCategoryDropdownJS = { 861 attach: function attach(context, settings) { 862 863 // Quick exit if the news category dropdown doesn't exist 864 if (!$('select[name="news-category-selector"]').length) return false; 865 866 /** 867 * Sets up the click event handlers for the news category dropdown 868 * @method setupSelectEvents 869 * @return {null} 870 */ 871 var setupSelectEvents = function setupSelectEvents() { 872 var dropdown = $('select[name="news-category-selector"]'); 873 874 dropdown.change(function () { 875 var selected = dropdown.find('option:selected'); 876 var queryString = ''; 877 878 if (selected.val() !== '') { 879 queryString = encodeURI('?news_category=' + selected.text().trim()); 880 window.location = window.location.protocol + '//' + window.location.host + '/news' + queryString; 881 } 882 }).select2({ 883 minimumResultsForSearch: -1, 884 containerCssClass: "news-category-selector-2" 885 }); 886 887 return null; 888 }; 889 890 $(document).ready(function () { 891 $('select[name="news-category-selector"]').once('setup-news-category-dropdown').each(function () { 892 // Call the category dropdown click event handler 893 setupSelectEvents(); 894 }); 895 }); 896 } 897 }; 898})(jQuery, Drupal, once); 899'use strict'; 900 901/** 902 * @file socialshare.js 903 */ 904(function ($, Drupal, once) { 905 'use strict'; 906 907 Drupal.behaviors.clientThemeFeatureSocialShareJS = { 908 attach: function attach(context, settings) { 909 910 if (!$('.share-container').length) { 911 return false; 912 } 913 914 var setupShareFeature = function setupShareFeature() { 915 var urlAddress = window.location.href; 916 var description = $('meta[name=title]').attr('content'); 917 918 $('.rrssb-buttons').rrssb({ 919 title: description, 920 url: urlAddress, 921 description: description, 922 emailBody: description 923 }); 924 925 $('.share-text').each(function () { 926 $(this).siblings('li').addClass('active-social'); 927 }); 928 }; 929 930 $(document).ready(function () { 931 once('setup-social-share-buttons', '.share-container').forEach(function (element) { 932 setupShareFeature(element); 933 }); 934 }); 935 } 936 }; 937})(jQuery, Drupal, once); 938'use strict'; 939 940/** 941 * @file vue.js 942 */ 943(function ($) { 944 'use strict'; 945 946 var alertWindowProcessed = false; 947 948 Drupal.behaviors.clientThemeVueJS = { 949 attach: function attach(context, settings) { 950 951 if (!$('.vue-element-container').length) { 952 return false; 953 } 954 955 /** 956 * Set the _vue objects for ease of use 957 */ 958 var _vue = { 959 alert: new vue_container($, 'alert-box-pop-out', '/data/api/alert-box?_format=json') 960 }; 961 962 /** 963 * Sets up the alert popout window 964 */ 965 var setupAlertPopOut = function setupAlertPopOut() { 966 967 if (alertWindowProcessed) { 968 return false; 969 } 970 971 // Make sure to only process the alert box once. 972 alertWindowProcessed = true; 973 974 // Fetch the vue data and creare the vue object 975 $.getJSON(_vue.alert.url, function (jsonData) { 976 977 // Move the vue object into place 978 _vue.alert.obj.prependTo($('body')); 979 980 // Create the new vue object 981 new Vue({ 982 el: '#' + _vue.alert.id, 983 data: { 984 cookieID: '', 985 alertCount: 0 986 }, 987 computed: { 988 alerts: function alerts() { 989 990 // Cookies are disabled, show alert all the time. 991 if (!cookiesAreEnabled()) { 992 return jsonData; 993 } else if (jsonData.length) { 994 var alerts = []; 995 this.cookieID = getCookieID('pwm_alert_window', jsonData[0].nid, jsonData[0].changed); 996 997 // Add the alert to the return array only if the cookie is not set. 998 if (!cookieIsSet(this.cookieID)) { 999 alerts.push(jsonData[0]); 1000 } 1001 1002 // Set the alert counter for future use. 1003 this.alertCount = alerts.length; 1004 1005 // return collected alerts 1006 return alerts; 1007 } 1008 } 1009 }, 1010 methods: { 1011 /** 1012 * Close the alert window pop-out 1013 */ 1014 closeWindow: function closeWindow() { 1015 // Set the cookies so it doesn't show again 1016 document.cookie = this.cookieID + '=1'; 1017 1018 // Remove the active class 1019 document.getElementById(_vue.alert.id).classList.remove('active'); 1020 } 1021 }, 1022 mounted: function mounted() { 1023 // App has mounted, check the alert counter to see if we need to show the container or not. 1024 if (this.alertCount > 0) { 1025 document.getElementById(_vue.alert.id).classList.add('active'); 1026 } 1027 } 1028 }); 1029 }); 1030 }; 1031 1032 $(document).ready(function () { 1033 1034 // Show the alert pop-out container if the container exists. 1035 if (_vue.alert.obj.length) {
1036 once('init-alert-pop-out', _vue.alert.obj).forEach(function () { 1037 setupAlertPopOut(); 1038 }); 1039 } 1040 }); 1041 } 1042 }; 1043})(jQuery); 1044'use strict'; 1045 1046/** 1047 * @file weather-api.js 1048 * 1049 * This functionality is build using https://openweathermap.org/ 1050 * 1051 * There is a script that pulls down the weather data incrementally and saves 1052 * it locally on the server in order to limit the number of hits to their system. 1053 * 1054 * https://openweathermap.org/current 1055 */ 1056(function ($, Drupal, once) { 1057 'use strict'; 1058 1059 Drupal.behaviors.clientThemeFeatureWeatherApiJS = { 1060 attach: function attach(context, settings) { 1061 1062 // Exit if the weather widget does not exist. 1063 if (!$('#block-weatherwidgetcontainer').length) { 1064 return false; 1065 } 1066 1067 // Set up the weather widget 1068 var setupWeatherWidget = function setupWeatherWidget() { 1069 __clientDebug('sets up weather widget'); 1070 1071 // Get the stored weather data 1072 $.ajax({ 1073 url: '/sites/default/files/data/weather.json' 1074 }) 1075 1076 // Process the weather data 1077 .done(function (data) { 1078 $('#block-weatherwidgetcontainer').html('').append($('<p/>').append($('<span/>').html(Math.round(data.main.temp) + '° ')).append($('<span/>').html(data.weather[0].description)).append($('<img/>').attr({ 1079 src: '//openweathermap.org/img/w/' + data.weather[0].icon + '.png', 1080 alt: data.weather[0].description 1081 }))); 1082 1083 // Refresh the weather widget every minute the page is loaded. 1084 setTimeout(function () { 1085 setupWeatherWidget(); 1086 }, 60000); 1087 }) 1088 1089 // Getting the weather data failed. Debug or do nothing. 1090 .fail(function () { 1091 __clientDebug('failed picking up the weather api'); 1092 }); 1093 }; 1094 1095 // load weather functionality 1096 $(document).ready(function () { 1097 // $('#block-weatherwidgetcontainer').once('setup-weather-widget-functionality').each(() => { 1098 // setupWeatherWidget(); 1099 // }); 1100 }); 1101 } 1102 }; 1103})(jQuery, Drupal, once); 1104'use strict'; 1105 1106/** 1107 * @file nav.js 1108 */ 1109(function ($) { 1110 'use strict'; 1111 // Use a flag to track whether the code has been executed 1112 var isCodeExecuted = false; 1113 Drupal.behaviors.clientThemeNavJS = { 1114 attach: function attach(context, settings) { 1115 1116 var buildsMobileNavMenu = function buildsMobileNavMenu() { 1117 1118 // Sets up the drop down layout for the main navigation 1119 $('#block-client-theme-main-menu').each(function () { 1120 $(this).find('.menu-item--expanded ul.menu').addClass('sub-menu'); 1121 }); 1122 1123 // Builds mega menu layout 1124 $('#block-client-theme-main-menu').find('.menu-item--expanded').each(function () { 1125 $(this).append($(this).find('.sub-menu')); 1126 }); 1127 1128 // Builds mobile menu tabs 1129 $('.mobile-menu').each(function () { 1130 $(this).find('.first-tier.menu-item--expanded').prepend($('<i/>').addClass('fal fa-plus mobile-menu-tab-trigger')); 1131 1132 $(this).find('.second-tier.menu-item--expanded').prepend($('<i/>').addClass('far fa-plus-circle mobile-menu-secondary-trigger')); 1133 }); 1134 1135 // Sets up the mobile menu click event 1136 $('.mobile-menu-tab-trigger').click(function () { 1137 1138 $('.mobile-menu-tab-trigger').removeClass('fa-minus').addClass('fa-plus'); 1139 1140 if ($(this).parent('.menu-item--expanded').children('ul').hasClass('active-toggle')) { 1141 $(this).removeClass('fa-minus').addClass('fa-plus'); 1142 $(this).parent('.menu-item--expanded').children('ul').removeClass('active-toggle'); 1143 } else { 1144 $('.menu-item--expanded ul').removeClass('active-toggle'); 1145 $(this).parent().find('.menu:first').toggleClass('active-toggle'); 1146 $(this).removeClass('fa-plus').addClass('fa-minus'); 1147 } 1148 }); 1149 1150 // Setup secondary menu mobile click event 1151 $('.mobile-menu-secondary-trigger').click(function () { 1152 $('.mobile-menu-secondary-trigger').removeClass('fa-minus-circle').addClass('fa-plus-circle'); 1153 1154 if ($(this).parent('.second-tier').children('ul').hasClass('active-toggle')) { 1155 $(this).removeClass('fa-minus-circle').addClass('fa-plus-circle'); 1156 $(this).parent('.second-tier').children('ul').removeClass('active-toggle'); 1157 } else { 1158 $('.second-tier ul').removeClass('active-toggle'); 1159 $(this).parent().find('.menu:first').toggleClass('active-toggle'); 1160 $(this).removeClass('fa-plus-circle').addClass('fa-minus-circle'); 1161 } 1162 }); 1163 }; 1164 1165 // Sets Trigger function for mobile menu 1166 var mobileClickExpand = function mobileClickExpand() { 1167 // Sets up the primary mobile menu click event 1168 $('.mobile-trigger').click(function () { 1169 $('.secondary-nav-bar').removeClass('hidden'); 1170 $('.mobile-menu').toggleClass('active-main-menu'); 1171 $('body').toggleClass('scroll'); 1172 1173 if ($(this).find('i').hasClass('fa-bars') && $('.mobile-menu').hasClass('active-main-menu')) { 1174 $(this).find('i').removeClass('fa-bars').addClass('fa-times'); 1175 } else { 1176 $(this).find('i').removeClass('fa-times').addClass('fa-bars'); 1177 $('.menu-item--expanded').children('ul').removeClass('active-toggle'); 1178 $('.mobile-menu-tab-trigger').removeClass('fa-minus').addClass('fa-plus'); 1179 } 1180 }); 1181 1182 $('#block-mainnavigation-4, .submenu-wrapper, #block-client-theme-main-menu--2 ul.menu').each(function () { 1183 $(this).find('a').addClass('hvr-fade'); 1184 }); 1185 }; 1186 1187 // Resets the menus to original state on screen resize to de
1187sktop 1188 var menuResponsiveReset = function menuResponsiveReset() { 1189 if ($(window).width() >= 1025 && $('.mobile-menu').hasClass('active-main-menu') || $(window).width() >= 1025 && $('.secondary-mobile-menu').hasClass('active-main-menu')) { 1190 $('.mobile-menu').removeClass('active-main-menu'); 1191 $('.mobile-trigger').find('i').removeClass('fa-times').addClass('fa-bars'); 1192 $('.mobile-menu').find('.menu').removeClass('active-toggle'); 1193 $('.mobile-menu-tab-trigger').removeClass('fa-minus').addClass('fa-plus'); 1194 $('.mobile-menu-secondary-trigger').removeClass('fa-minus-circle').addClass('fa-plus-circle'); 1195 $('body').removeClass('scroll'); 1196 } 1197 }; 1198 1199 // Sets up secondary Nav social layouts and icons 1200 var buildsSecondaryMenuLayout = function buildsSecondaryMenuLayout() { 1201 1202 $('#block-secondarynavbar').each(function () { 1203 // Clear out the link copy 1204 1205 $(this).find('ul.menu li a.fab').each(function () { 1206 $(this).text(''); 1207 }); 1208 1209 $(this).find('.fa-facebook').removeClass('fa-facebook').append($('<span>').addClass('fa-stack fa-2x').append($('<i>').addClass('fas fa-circle fa-stack-2x')).append($('<i>').addClass('fab fa-facebook-f fa-stack-1x fa-inverse'))); 1210 1211 $(this).find('.fa-twitter').removeClass('fa-twitter').append($('<span>').addClass('fa-stack fa-2x').append($('<i>').addClass('fas fa-circle fa-stack-2x')).append($('<i>').addClass('fab fa-twitter fa-stack-1x fa-inverse'))); 1212 1213 $(this).find('.fa-linkedin').removeClass('fa-linkedin').append($('<span>').addClass('fa-stack fa-2x').append($('<i>').addClass('fas fa-circle fa-stack-2x')).append($('<i>').addClass('fab fa-linkedin-in fa-stack-1x fa-inverse'))); 1214 }); 1215 }; 1216 1217 // Sets the max height on the mobile menu 1218 var setMaxHeightOnMobileMenu = function setMaxHeightOnMobileMenu() { 1219 $('.mobile-menu').css({ "overflow": "scroll", "maxHeight": $(window).height() - $('header.header').height() }); 1220 }; 1221 1222 $(document).ready(function () { 1223 // Check if the code has been executed 1224 if (!isCodeExecuted) { 1225 // Your existing code without the once function 1226 buildsMobileNavMenu(); 1227 mobileClickExpand(); 1228 buildsSecondaryMenuLayout(); 1229 1230 // Set a timeout for the remaining functions 1231 setTimeout(function () { 1232 setMaxHeightOnMobileMenu(); 1233 }, 1000); 1234 1235 // Handle window resize 1236 $(window).resize(function () { 1237 menuResponsiveReset(); 1238 setMaxHeightOnMobileMenu(); 1239 }); 1240 1241 // Set the flag to true to indicate that the code has been executed 1242 isCodeExecuted = true; 1243 } 1244 }); 1245 } 1246 }; 1247})(jQuery); 1248'use strict'; 1249 1250/** 1251 * @file airlines-agg.js 1252 */ 1253(function ($, Drupal, once) { 1254 'use strict'; 1255 1256 Drupal.behaviors.clientThemeAirlinesAggJS = { 1257 attach: function attach(context, settings) { 1258 // Exit if the page doesn't have the airline listing block 1259 if (!$('#block-views-block-airlines-block-2').length) { 1260 return false; 1261 } 1262 1263 // Airlines toggle setup switch 1264 var buildAirlinesAgg = function buildAirlinesAgg() { 1265 1266 $('.vocabulary-destinations').each(function () { 1267 var byline = $(this).find('.field--name-field-byline'); 1268 var bytexts = byline.text(); 1269 var titlecontainer = $(this).find('#destination-title-container'); 1270 $(byline).text('(' + bytexts + ')'); 1271 titlecontainer.append(byline); 1272 }); 1273 }; 1274 1275 var airlineTabToggle = function airlineTabToggle() { 1276 $('#block-views-block-airlines-block-2').each(function () { 1277 1278 $(this).find('.tab-toggle').click(function () { 1279 $(this).parent().parent().parent().find('.airline-body').toggleClass('active-airline'); 1280 1281 if ($(this, 'i').hasClass('fa-plus-circle') && $('.airline-body').hasClass('active-airline')) { 1282 $(this, 'i').removeClass('fa-plus-circle').addClass('fa-minus-circle'); 1283 } else { 1284 $(this, 'i').removeClass('fa-minus-circle').addClass('fa-plus-circle'); 1285 } 1286 }); 1287 }); 1288 }; 1289 1290 var resetAirlineTabToggle = function resetAirlineTabToggle() { 1291 // Sets Responsive reset to menus 1292 if ($(window).width() >= 1025 && $('.airline-body').hasClass('active-airline') || $(window).width() >= 1025 && $('.secondary-mobile-menu').hasClass('active-main-menu')) { 1293 $('.airline-body').removeClass('active-airline');; 1294 } 1295 }; 1296 1297 $(document).ready(function () { 1298 once('airlineaggregation', '#block-views-block-airlines-block-2').forEach(function (element) { 1299 buildAirlinesAgg(element); 1300 airlineTabToggle(element); 1301 1302 $(window).resize(function () { 1303 resetAirlineTabToggle(element); 1304 }); 1305 }); 1306 }); 1307 } 1308 }; 1309})(jQuery, Drupal, once); 1310'use strict'; 1311 1312/** 1313 * @file fp-airlines.js 1314 */ 1315(function ($, Drupal) { 1316 'use strict'; 1317 1318 Drupal.behaviors.clientThemeViewAirlineSliderJS = { 1319 attach: function (context, settings) { 1320 // Exit if the page doesn't have the news listing block 1321 if ($(context).find('#block-views-block-airlines-block-1').length) { 1322 // HP News Teaser setup 1323 var buildHpAirlinesSlider = function () { 1324 $('#block-views-block-airlines-block-1', context).each(function () { 1325 var airlineslider = $(this).find('.view-content'); 1326 var airlinescount = $(this).find('.views-row').length; 1327 1328 $(airlineslider).slick({ 1329 infinite: true, 1330 draggable: true, 1331 slidesToShow: 7, 1332 slidesToScroll: 1, 1333 prevArrow: "<i class='a-left control-c prev arrow-left far fa-angle-left'></i>", 1334 nextArrow: "<i class='a-right control-c next arrow-right far fa-angle-right'></i>", 1335 responsive: [{ 1336 breakpoint: 1024, 1337 settings: { 1338 prevArrow: "<i class='a-left control-c prev arrow-left far fa-angle-left'></i>", 1339 nextArrow: "<i class='a-right control-c next arrow-right far fa-angle-right'></i>", 1340 infinite: true, 1341 slidesToShow: 5, 1342 slidesToScroll: 1 1343 } 1344 }, { 1345 breakpoint: 768, 1346 settings: { 1347 prevArrow: "<i class='a-left control-c prev arrow-left far fa-angle-left'></i>", 1348 nextArrow: "<i class='a-right control-c next arrow-right far fa-angle-right'></i>", 1349 infinite: true, 1350 slidesToShow: 5, 1351 slidesToScroll: 1 1352 } 1353 }, { 1354 breakpoint: 480, 1355 settings: { 1356 prevArrow: "<i class='a-left control-c prev arrow-left far fa-angle-left'></i>", 1357 nextArrow: "<i class='a-right control-c next arrow-right far fa-angle-right'></i>", 1358 infinite: true, 1359 slidesToShow: 3, 1360 slidesToScroll: 1 1361 } 1362 }] 1363 }).addClass('active-slideshow'); 1364 }); 1365 }; 1366 1367 $(document).ready(function () { 1368 buildHpAirlinesSlider(context); 1369 }); 1370 } 1371 } 1372 }; 1373 1374})(jQuery, Drupal); 1375 1376'use strict'; 1377 1378/** 1379 * @file news-listing.js 1380 */ 1381(function ($) { 1382 'use strict'; 1383 1384 Drupal.behaviors.clientThemeViewNewsListingJS = { 1385 attach: function attach(context, settings) { 1386 1387 // Exit if the page doesn't have the news listing block 1388 if (!$('#block-views-block-news-listing-block-1').length) { 1389 return false;
1390 } 1391 1392 // HP News Teaser setup 1393 var buildOutHpNewsTeaser = function buildOutHpNewsTeaser() { 1394 1395 $('#block-views-block-news-listing-block-1').each(function () { 1396 // Set up Vars 1397 var teaserTitleText = $(this).find('.node__title a').text().trim(); 1398 var teaserTitleLink = $(this).find('.node__title a').attr('href'); 1399 var articleH3Container = $('<h3>').text(teaserTitleText); 1400 1401 // Build Title Out 1402 $(this).find('.hp-news-text-container').prepend($('<a>').attr('href', teaserTitleLink).append(articleH3Container)); 1403 1404 // Setup Read More button 1405 $(this).find('.primary-button').attr('href', teaserTitleLink); 1406 }); 1407 }; 1408 1409 $(document).ready(function () { 1410 once('setup-news-listing-block', '#block-views-block-news-listing-block-1').forEach(function (element) { 1411 buildOutHpNewsTeaser(element); 1412 }); 1413 }); 1414 } 1415 }; 1416})(jQuery); 1417'use strict'; 1418 1419/** 1420 * @file parking-lot.js 1421 */ 1422(function ($) { 1423 'use strict'; 1424 1425 Drupal.behaviors.clientThemeViewParkingLotBarJS = { 1426 attach: function attach(context, settings) { 1427 1428 // Exit if the page doesn't have the news listing block 1429 if (!$('.mobile-parking-lot-button').length) return false; 1430 1431 $(document).ready(function () { 1432 once('adjust-parking-bar', '.mobile-parking-lot-button').forEach(function (element) { 1433 1434 // Setup Click function for parking update section 1435 $('.dektop-parking-lot-button, .mobile-parking-lot-button').click(function () { 1436 window.location.href = '/parking'; 1437 }); 1438 1439 var parkingText = $(element).find('.parking-text').html(); 1440 $(element).find('.parking-text').text(parkingText.replace('<br/>', ' ').replace('<br>', ' ')); 1441 }); 1442 }); 1443 } 1444 }; 1445})(jQuery); 1446'use strict'; 1447 1448/** 1449 * @file parking-lot.js 1450 */ 1451(function ($) { 1452 'use strict'; 1453 1454 Drupal.behaviors.clientThemeViewParkingPageJS = { 1455 attach: function attach(context, settings) { 1456 1457 // Exit if the page doesn't have the parking listing block 1458 if (!$('.block-views-block-parking-lots-block-1').length) return false; 1459 1460 // Parking Lot setup 1461 var buildOutParkingLotLayout = function buildOutParkingLotLayout() { 1462 $('.views-row').each(function () { 1463 // Set up Vars 1464 var notStaticDiv = $(this).find('.not-static'); 1465 1466 if ($(window).width() < 768) { 1467 notStaticDiv.addClass('hidden'); 1468 $('.open-close-toggle').removeClass('fa-minus active').addClass('fa-plus'); 1469 } else { 1470 notStaticDiv.removeClass('hidden'); 1471 } 1472 1473 $(this).addClass('loaded'); 1474 }); 1475 }; 1476 1477 var parkingClickAction = function parkingClickAction() { 1478 $('.open-close-toggle').click(function () { 1479 var parkingcontainer = $(this).parent(); 1480 var parkingcontainerparent = parkingcontainer.parent().parent(); 1481 var hiddenchildren = parkingcontainerparent.find('.not-static'); 1482 1483 if ($(this).hasClass('active')) { 1484 $(this).removeClass('active'); 1485 $('.open-close-toggle').removeClass("active"); 1486 $(this).removeClass('fa-minus').addClass('fa-plus'); 1487 hiddenchildren.addClass('hidden'); 1488 } else { 1489 $(this).addClass("active"); 1490 $(this).removeClass('fa-plus').addClass('fa-minus'); 1491 hiddenchildren.removeClass('hidden'); 1492 } 1493 }); 1494 }; 1495 1496 var parkingModalClickAction = function parkingModalClickAction() { 1497 $('.map-modal-icon-desktop').click(function () { 1498 var body = $('body'); 1499 var modal = $(this).find('.map-modal'); 1500 1501 if ($(this).hasClass('active')) { 1502 $(this).removeClass('active'); 1503 $('.map-modal-icon-desktop').removeClass("active"); 1504 modal.addClass('hidden'); 1505 body.removeClass('scroll'); 1506 } else { 1507 $(this).addClass("active"); 1508 modal.removeClass('hidden'); 1509 body.addClass('scroll'); 1510 } 1511 1512 // screen reset 1513 if ($(window).width() < 768) { 1514 $('.map-modal-icon-desktop').removeClass('active'); 1515 $('.map-modal').addClass('hidden'); 1516 body.removeClass('scroll'); 1517 } 1518 }); 1519 }; 1520 1521 $(document).ready(function () { 1522 once('setup-parking-lot-block', '.block-views-block-parking-lots-block-1').forEach(function (element) { 1523 buildOutParkingLotLayout(element); 1524 parkingClickAction(element); 1525 parkingModalClickAction(element); 1526 }); 1527 1528 $(window).resize(function () { 1529 buildOutParkingLotLayout(); 1530 }); 1531 }); 1532 } 1533 }; 1534})(jQuery); 1535"use strict"; 1536 1537/** 1538 * @file staff-grid.js 1539 */ 1540(function ($) { 1541 'use strict'; 1542 1543 Drupal.behaviors.clientThemeStaffGridJS = { 1544 attach: function attach(context, settings) { 1545 1546 if ($("#block-views-block-staff-block-1").length <= 0) return false;
1547 1548 var adjustStaffGrid = function adjustStaffGrid() { 1549 var maxHeight = 0; 1550 1551 var element = $("#block-views-block-staff-block-1 .view-content .views-row"); 1552 1553 element.removeAttr('style'); 1554 1555 element.each(function () { 1556 if ($(this).height() > maxHeight) maxHeight = $(this).height(); 1557 }); 1558 1559 element.height(Math.ceil(maxHeight)); 1560 }; 1561 1562 $(document).ready(function () { 1563 adjustStaffGrid(); 1564 setTimeout(function () { 1565 adjustStaffGrid(); 1566 }, 1000); 1567 }); 1568 1569 $(window).resize(function () { 1570 adjustStaffGrid(); 1571 }); 1572 } 1573 }; 1574})(jQuery);
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.