$( document ).on('turbolinks:load', function() { // Add slideDown animation to Bootstrap dropdown when expanding. $('.dropdown').on('show.bs.dropdown', function() { $(this).find('.dropdown-menu').first().stop(true, true).addClass("visible"); }); // Add slideUp animation to Bootstrap dropdown when collapsing. $('.dropdown').on('hide.bs.dropdown', function() { $(this).find('.dropdown-menu').first().stop(true, true).removeClass("visible"); }); $(document).on("click","#open-mobile-slideout", function(e) { e.preventDefault(); if ($(".event-dashboard-left").length > 0) { if ($(".event-dashboard-left").hasClass("active")) { $(".event-dashboard-left").removeClass("active") } else { $(".event-dashboard-left").addClass("active"); } } else { $(".mobile-slideout").addClass("open"); $("body").addClass("modal-open"); } }); $(document).on("click",".mobile-slideout-cover, .mobile-close", function(e) { e.preventDefault(); $(".mobile-slideout").removeClass("open"); $("body").removeClass("modal-open"); }); $('[data-toggle="tooltip"]').tooltip({trigger: "hover"}); document.addEventListener("turbolinks:before-cache", function () { $('[data-toggle="tooltip"]').tooltip('hide'); }); }); $( document ).ready(function() { setTimeout(function(){ $(".alert").addClass("visible"); $(".well-promo").slideDown(200); setTimeout(function() { $(".alert").removeClass("visible"); }, 5000); $(document).on("click",".fa-times-circle", function() { $(this).parent(".alert").removeClass("visible"); }); }, 300); $(".scroll-link").click(function (){ var dest = $(this).attr("href"); $('html, body').animate({ scrollTop: $(dest).offset().top }, 400); return false; }); $('[data-toggle="tooltip"]').tooltip({trigger: "hover"}); $(document).on("click","#open-mobile-slideout", function(e) { e.preventDefault(); if ($(".event-dashboard-left").length > 0) { if ($(".event-dashboard-left").hasClass("active")) { $(".event-dashboard-left").removeClass("active") } else { $(".event-dashboard-left").addClass("active"); } } else { $(".mobile-slideout").addClass("open"); $("body").addClass("modal-open"); } }); $(document).on("click",".mobile-slideout-cover, .mobile-close", function(e) { e.preventDefault(); $(".mobile-slideout").removeClass("open"); $("body").removeClass("modal-open"); }); });