close responsiveNav after click for mobile

This commit is contained in:
Sam Artioli 2021-05-05 21:56:26 -04:00
parent 90578a5d36
commit 8c4b7f0128
3 changed files with 26 additions and 5464 deletions

15
dist/js/scripts.js vendored
View File

@ -38,4 +38,19 @@ window.addEventListener('DOMContentLoaded', event => {
}); });
}; };
// Collapse responsive navbar when toggler is visible.
const navbarToggler = document.body.querySelector('.navbar-toggler');
const responsiveNavItems = [].slice.call(
document.querySelectorAll('#navbarResponsive .nav-link')
);
responsiveNavItems.map(function (responsiveNavItem) {
console.log(responsiveNavItem);
responsiveNavItem.addEventListener('click', () => {
console.log('asd');
navbarToggler.click();
});
});
}); });

5464
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -33,4 +33,15 @@ window.addEventListener('DOMContentLoaded', event => {
}); });
}; };
// Collapse responsive navbar when toggler is visible.
const navbarToggler = document.body.querySelector('.navbar-toggler');
const responsiveNavItems = [].slice.call(
document.querySelectorAll('#navbarResponsive .nav-link')
);
responsiveNavItems.map(function (responsiveNavItem) {
responsiveNavItem.addEventListener('click', () => {
navbarToggler.click();
});
});
}); });