PageSourceSearch

https://www.treehousehotels.com/themes/custom/treehouse/assets/js/member.js?tm513h

js treehousehotels.com collected 2026-10-01 12:19:39 UTC 3,347 bytes, 96 lines download raw bytes

1(function ($, Drupal) {
2  'use strict';
3
4  // Member.
5  Drupal.behaviors.member = {
6    attach: function (context, settings) {
7      // Member menu.
8      var mainHeader = $('header[role="banner"]');
9      var missionHamburgerBtn = $('nav.menu--members-sf .nav-toggle');
10      var missionNav = $('nav.menu--members-sf .subnav-stick ul.menu');
11      var missionReturnLinks = $('nav.menu--members-sf .subnav-stick .return-link');
12      var membersSection = $('section.members');
13
14      if ( membersSection.length > 0 ) {
15        $(window).on('load', function(){
16          mainHeader.addClass('sticky');
17        });
18      }
19
20      missionHamburgerBtn.on('click', function() {
21        missionNav.toggleClass('mobile-show');
22        missionReturnLinks.toggleClass('mobile-show');
23        missionHamburgerBtn.toggleClass('mobile-show');
24        mainHeader.toggleClass('mobile-open');
25      });
26
27      $(window).on('resize', function() {
28        var currentScreenWidth = window.innerWidth;
29        if (currentScreenWidth >= 1280 ) {
30          missionHamburgerBtn.removeClass('mobile-show');
31          missionNav.removeClass('mobile-show');
32          missionReturnLinks.removeClass('mobile-show');
33        }
34      });
35    }
36  };
37
38  // My Reservation modal.
39  Drupal.behaviors.myReservations = {
40    init: false,
41    attach: function (context, settings) {
42      const $myReservations = $('.my-reservations');
43      if ($myReservations.length && !Drupal.behaviors.myReservations.init) {
44        Drupal.behaviors.myReservations.init = true;
45        Drupal.behaviors.myReservations.manageTabIndex($myReservations);
46
47        const observer = new MutationObserver(function(mutations) {
48          mutations.forEach(function(mutation) {
49            if (mutation.attributeName === 'style') {
50              Drupal.behaviors.myReservations.manageTabIndex($myReservations);
51              Drupal.behaviors.myReservations.manageAriaHidden($myReservations);
52            }
53          });
54        });
55
56        observer.observe($myReservations[0], { attributes: true });
57      }
58    },
59    manageAriaHidden: function ($myReservations) {
60      const $modal = $myReservations.find('.modal');
61      const $close = $modal.find('.modal__close');
62      if ($modal.length) {
63        $modal.attr('aria-hidden', $myReservations.is(':visible') ? 'false' : 'true');
64      }
65
66      if ($close.length) {
67        $close.attr('aria-hidden', $myReservations.is(':visible') ? 'false' : 'true');
68      }
69    },
70    manageTabIndex: function ($myReservations) {
71      if ($myReservations.is(':visible')) {
72        $myReservations.find('[tabindex="-1"]').each(function() {
73          const $el = $(this);
74          if ($el.data('original-tabindex')) {
75            $el.attr('tabindex', $el.data('original-tabindex'));
76          } else {
77            $el.removeAttr('tabindex');
78          }
79        });
80        return;
81      }
82
83      $myReservations.find('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])').each(function() {
84        const $el = $(this);
85        if (!$el.data('original-tabindex') && $el.attr('tabindex')) {
86          $el.data('original-tabindex', $el.attr('tabindex'));
87        } else if (!$el.data('original-tabindex')) {
88          $el.data('original-tabindex', '0');
89        }
90        $el.attr('tabindex', '-1');
91      });
92    }
93  };
94
95
96})(jQuery, Drupal);

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.