diff --git a/assets/js/mobile.js b/assets/js/mobile.js index 7e26693..b805e33 100644 --- a/assets/js/mobile.js +++ b/assets/js/mobile.js @@ -7,21 +7,15 @@ 'use strict'; - // Activate the mobil menu for small screens. - if (window.matchMedia && $('.mobile-nav').length) { - var mq = window.matchMedia('(max-width: 999px)'); - if (mq.matches) { - // Toggle the mobile nav sheet. - $('.mobile-nav__cover, .mobile-nav__toggle').handle('click', function () { - $('body').scroll().toggleClass('js-nav-open'); - }); + // Toggle the mobile nav sheet. + $('.mobile-nav__cover, .mobile-nav__toggle').handle('click', function () { + $('body').scroll().toggleClass('js-nav-open'); + }); - // Close the nav sheet after click (needed for anchor links). - $('.mobile-nav__sheet').find('a').on('click', function () { - $('body').removeClass('js-nav-open'); - }); - } - } + // Close the nav sheet after click (needed for anchor links). + $('.mobile-nav__sheet').find('a').on('click', function () { + $('body').removeClass('js-nav-open'); + }); })(u);