Simplify the mobile.js.

This commit is contained in:
Fredrik Jonsson 2022-08-07 15:47:59 +02:00
commit f4bdc66a40

View file

@ -7,10 +7,6 @@
'use strict'; '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. // Toggle the mobile nav sheet.
$('.mobile-nav__cover, .mobile-nav__toggle').handle('click', function () { $('.mobile-nav__cover, .mobile-nav__toggle').handle('click', function () {
$('body').scroll().toggleClass('js-nav-open'); $('body').scroll().toggleClass('js-nav-open');
@ -20,8 +16,6 @@
$('.mobile-nav__sheet').find('a').on('click', function () { $('.mobile-nav__sheet').find('a').on('click', function () {
$('body').removeClass('js-nav-open'); $('body').removeClass('js-nav-open');
}); });
}
}
})(u); })(u);