Close the nav sheet after click (needed for anchor links).

This commit is contained in:
Fredrik Jonsson 2018-05-16 12:34:20 +02:00
commit 9635284f60
2 changed files with 6 additions and 2 deletions

View file

@ -35,7 +35,7 @@
});
// Mark the form as submitted.
$contact_button.on('click touchstart MSPointerDown', function () {
$contact_button.click(function () {
$contact_form.addClass('js-submitted');
});

View file

@ -22,11 +22,15 @@
$('.main-menu').addClass('hidden').clone().removeClass('main-menu layout__navigation hidden').addClass('js-main-menu').appendTo('.mobile-nav-sheet').find('.navbar').removeClass('navbar').addClass('js-navbar');
// Toggle the mobile nav sheet.
$('.mobile-nav-cover, .mobile-nav-toggle').on('click toushstart', function (e) {
$('.mobile-nav-cover, .mobile-nav-toggle').click(function (e) {
e.preventDefault();
$('body').scrollTop(0).toggleClass('js-nav-open');
});
// Close the nav sheet after click (needed for anchor links).
$('.mobile-nav-sheet').find('a').click(function () {
$('body').removeClass('js-nav-open');
});
}
}