$(function () { $(window).scroll(function () { let detailsTabNavTop = $("#details-tab-nav")[0].getBoundingClientRect().top; if (detailsTabNavTop == 0) { $("#details-tab-nav").addClass("sticky"); } else { $("#details-tab-nav").removeClass("sticky"); } }); let departBaggageSlider = $("#depart-baggage-slider").owlCarousel({ loop: false, margin: 10, dots: false, responsiveClass: true, responsive: { 0: { items: 1, nav: true, }, 300: { items: 2, nav: true, }, 500: { items: 3, nav: false, }, 700: { items: 4, nav: true, loop: false, }, }, }); let returnBaggageSlider = $("#return-baggage-slider").owlCarousel({ loop: false, margin: 10, dots: false, responsiveClass: true, responsive: { 0: { items: 1, nav: true, }, 300: { items: 2, nav: true, }, 500: { items: 3, nav: false, }, 700: { items: 4, nav: true, loop: false, }, }, }); let departMealsSlider = $("#depart-meals-slider").owlCarousel({ loop: false, margin: 10, dots: false, responsiveClass: true, responsive: { 0: { items: 1, nav: true, }, 300: { items: 2, nav: true, }, 500: { items: 3, nav: false, }, 700: { items: 4, nav: true, loop: false, }, }, }); $("select").formSelect(); $("#addFlightModalBtn").click((event) => { let sectorOpened = false; let firstTimeOpened = false; let timeoutVar = null; $("#modal-city-field").focus(); $("#sector-search").show(); $("#sector-search .top input").focus(); firstTimeOpened = true; sectorOpened = true; $("#modal-city-field").on("focus", () => { $("#sector-search").show(); $("#sector-search .top input").focus(); setTimeout(() => { sectorOpened = true; firstTimeOpened = true; if (timeoutVar) { clearTimeout(timeoutVar); } }, 50); }); $(document).click(function (event) { var $target = $(event.target); if (firstTimeOpened) { firstTimeOpened = false; return; } if (sectorOpened && !$target.closest("#sector-search").length) { sectorOpened = false; $("#sector-search").hide(); firstClick = false; } if (timeoutVar) { clearTimeout(timeoutVar); } }); }); $('.slider-outer').hide(); $('.seating-section').hide(); $('.addrow p').click(function() { $(this).parent().parent().find('span.ak-minus').removeClass('ak-minus').addClass('ak-add'); $(this).find('span.ak-add').removeClass('ak-add').addClass('ak-minus'); $(this).parent().parent().next().show(); }); $('.slider-outer .closeicon').click(function() { $(this).parent().parent().find('.addrow span.ak-minus').removeClass('ak-minus').addClass('ak-add'); $(this).parent().hide(); }); $('.seating-section .closeicon').click(function() { $(this).parent().parent().find('.addrow span.ak-minus').removeClass('ak-minus').addClass('ak-add'); $(this).parent().hide(); }); $('#fareRulemodal .sidenav-close').click(function() { $('#addFlightmodal').sidenav('close'); }); $('#fareRulemodal .back-icon').click(function() { $('#fareRulemodal').sidenav('close'); setTimeout(() => { $(document.body).css('overflow', 'hidden'); }, 50); }); $('#flightDetailModal .back-icon').click(function() { $('#flightDetailModal').sidenav('close'); setTimeout(() => { $(document.body).css('overflow', 'hidden'); }, 50); }); $('#flightDetailModal .sidenav-close').click(function() { $('#addFlightmodal').sidenav('close'); }); $('.fareRulemodalBtn').click(function() { $('#fareRulemodal .back-icon').hide(); }); $('#addFlightmodal #fareRulemodalBtn').click(function() { $('#fareRulemodal .back-icon').show(); }); });