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