simplify mobile submenu event listener code
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
58c5a42873
commit
5ca22cce04
@ -31,8 +31,8 @@
|
||||
|
||||
// for toggling submenus in mobile navigation drawer
|
||||
let submenuLinks = document.querySelectorAll('.drawer .has-submenu');
|
||||
[...submenuLinks].forEach(function(submenuLink) {
|
||||
submenuLink.addEventListener('click', () => {
|
||||
[...submenuLinks].forEach(submenuLink => {
|
||||
submenuLink.addEventListener('click', function() {
|
||||
submenuLink.querySelector('.submenu').classList.toggle('opened')
|
||||
})
|
||||
})
|
||||
|
Loading…
Reference in New Issue
Block a user