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 = $('.be-modal.' + modal); 8 if ($(window).outerWidth() <= 1024) { 9 // Mobile - Get Header and Footer Heights for .be-modal-main grid height calculation for ios12 iphone6 10 var modalHeaderHeight = thisModal.find('.be-modal-header-bar').outerHeight(); 11 var modalFooterHeight = thisModal.find('.be-modal-footer-bar').outerHeight(); 12 var calcHeight = modalHeaderHeight + modalFooterHeight 13 thisModal.find('.be-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 = $('.be-modal.open'); 39 $('html').removeClass('modal-open'); 40 currentOpenedModal.removeClass('open'); 41} 42 43//////////////////// 44// Document Ready // 45//////////////////// 46 47$(document).ready(function () { 48 49 // BE - Modal Tabindex -1 on page load for ADA Compliance 50 $('.be-modal input, .be-modal button, .be-modal select').attr('tabindex', '-1'); 51 52 // BE - Toggle Any Modal using data-be-modal="classname" 53 $('[data-be-modal]').on('click', function () { 54 var modal = $(this).attr('data-be-modal'); 55 var thisModal = $('.be-modal.' + modal); 56 $('html').toggleClass('modal-open'); 57 mobileModalGridFix(modal); 58 thisModal.toggleClass('open'); 59 // BE - Modal Tabindex 0 for ADA Compliance 60 $('.be-modal input, .be-modal button, .be-modal select').attr('tabindex', '0'); 61 // BE - Close any opened Tooltip 62 if ($('[data-toggle="tooltip"]').attr('data-original-title')) { 63 $('[data-toggle="tooltip"]').tooltip('hide'); 64 } 65 }); 66 67 // BE - Close Modal 68 $('.be-modal-close').on('click', function () { 69 closeModal(); 70 }); 71 72 // BE - Close Modal on outside click 73 $('.be-modal').on('click', function (e) { 74 if (e.target !== e.currentTarget) return; 75 closeModal(); 76 }); 77 78 // BE - Close Modal when ESC key is pressed 79 $(document).on('keyup',function(evt) { 80 if (evt.keyCode == 27) { 81 closeModal(); 82 } 83 }); 84 85});
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.