close responsiveNav after click for mobile
This commit is contained in:
parent
90578a5d36
commit
8c4b7f0128
15
dist/js/scripts.js
vendored
15
dist/js/scripts.js
vendored
@ -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
5464
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@ -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();
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user