make sub-menus toggle-able in mobile navigation drawer
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
9ca8e5c445
commit
453b26f041
@ -28,6 +28,14 @@
|
||||
document.querySelector('#thumb-'+ id).remove();
|
||||
}
|
||||
document.querySelector('[aria-label="Previous"]').parentElement.classList.add('previous-page-link')
|
||||
|
||||
// for toggling submenus in mobile navigation drawer
|
||||
let submenuLinks = document.querySelectorAll('.drawer .has-submenu');
|
||||
[...submenuLinks].forEach(function(submenuLink) {
|
||||
submenuLink.addEventListener('click', () => {
|
||||
submenuLink.querySelector('.submenu').classList.toggle('opened')
|
||||
})
|
||||
})
|
||||
</script>
|
||||
|
||||
</html>
|
||||
|
@ -255,7 +255,12 @@ body {
|
||||
}
|
||||
|
||||
#top-menu .drawer .submenu {
|
||||
visibility: hidden;
|
||||
position: initial;
|
||||
display: none;
|
||||
}
|
||||
|
||||
#top-menu .drawer .submenu.opened {
|
||||
display: flex;
|
||||
}
|
||||
|
||||
#top-menu .drawer .submenu li {
|
||||
@ -270,6 +275,9 @@ body {
|
||||
.drawer .has-submenu {
|
||||
padding-left: 1em;
|
||||
margin-left: 5px;
|
||||
color: #333;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
|
||||
@ -870,6 +878,10 @@ footer a:hover {
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
#top-menu ul.submenu {
|
||||
position: initial;
|
||||
}
|
||||
|
||||
.drawer ul li {
|
||||
padding: 1em 0;
|
||||
/* border-bottom: 1px solid #333; */
|
||||
|
Loading…
Reference in New Issue
Block a user