PageSourceSearch

https://www.seasidevacations.com/bookingEngine/javascripts/be/modal.js?v=55

js seasidevacations.com collected 2026-09-29 16:54:38 UTC 2,718 bytes, 84 lines download raw bytes

1//////////////////////
2// Global Functions //
3//////////////////////
4
5// BE - Mobile Modal Grid Fix - Fixes CSS Grid for Mobile iphone6 ios12
6function mobileModalGridFix(modal) {
7  var thisModal = $('.i-modal.' + modal);
8  if ($(window).outerWidth() <= 1024) {
9    // Mobile - Get Header and Footer Heights for .i-modal-main grid height calculation for ios12 iphone6
10    var modalHeaderHeight = thisModal.find('.i-modal-header-bar').outerHeight();
11    var modalFooterHeight = thisModal.find('.i-modal-footer-bar').outerHeight();
12    var calcHeight = modalHeaderHeight + modalFooterHeight
13    thisModal.find('.i-modal-body').css({
14      'grid-template-rows': modalHeaderHeight + 'px' + ' calc(100% - ' + calcHeight + 'px) ' + modalFooterHeight + 'px'
15    });
16  }
17}
18
19// BE - Open Modal JS Function
20function openModal(className) {
21  // BE - Close any opened Tooltip
22  if ($('[data-toggle="tooltip"]').attr('data-original-title')) {
23    $('[data-toggle="tooltip"]').tooltip('hide');
24  }
25  // BE - Open Modal
26  $('html').addClass('modal-open');
27  $('.' + className).addClass('open');
28  mobileModalGridFix(className);
29}
30
31// BE - Close Modal JS Function
32function closeModal() {
33  // BE - Close any opened Tooltip
34  if ($('[data-toggle="tooltip"]').attr('data-original-title')) {
35    $('[data-toggle="tooltip"]').tooltip('hide');
36  }
37  // BE - Close Modal
38  var currentOpenedModal = $('.i-modal.open');
39  $('html').removeClass('modal-open');
40  currentOpenedModal.removeClass('open');
41}
42
43////////////////////
44// Document Ready //
45////////////////////
46$(document).ready(function () {
47
48  // BE - Modal Tabindex -1 on page load for ADA Compliance
49  $('.i-modal input, .i-modal button, .i-modal select').attr('tabindex', '-1');
50
51  // BE - Toggle Any Modal using data-i-modal="classname"
52  $('[data-i-modal]').on('click', function () {
53    var modal = $(this).attr('data-i-modal');
54    var thisModal = $('.i-modal.' + modal);
55    $('html').toggleClass('modal-open');
56    mobileModalGridFix(modal);
57    thisModal.toggleClass('open');
58    // BE - Modal Tabindex 0 for ADA Compliance
59    $('.i-modal input, .i-modal button, .i-modal select').attr('tabindex', '0');
60    // BE - Close any opened Tooltip
61    if ($('[data-toggle="tooltip"]').attr('data-original-title')) {
62      $('[data-toggle="tooltip"]').tooltip('hide');
63    }
64  });
65
66  // BE - Close Modal
67  $('.i-modal-close').on('click', function () {
68    closeModal();
69  });
70
71  // BE - Close Modal on outside click
72  $('.i-modal').on('click', function (e) {
73    if (e.target !== e.currentTarget) return;
74    closeModal();
75  });
76
77  // BE - Close Modal when ESC key is pressed
78  $(document).on('keyup',function(evt) {
79    if (evt.keyCode == 27) {
80      closeModal();
81    }
82  });
83
84});

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.