indicate if menu has been expanded

This commit is contained in:
Mouse Reeve 2020-11-09 11:58:19 -08:00
parent 607612a1d9
commit 79f7c55a04
2 changed files with 5 additions and 1 deletions

View file

@ -50,6 +50,10 @@ function tabChange(e, nested) {
target.className = 'is-active';
}
function toggleMenu(el) {
el.setAttribute('aria-expanded', el.getAttribute('aria-expanded') == 'false');
}
function ajaxPost(form) {
fetch(form.action, {
method : "POST",

View file

@ -36,7 +36,7 @@
</div>
</form>
<label for="main-nav" role="button" class="navbar-item" aria-label="menu" aria-expanded="false" data-target="mainNav">
<label for="main-nav" role="button" class="navbar-item" aria-label="menu" aria-expanded="false" data-target="mainNav" onclick="toggleMenu(this)">
<div class="icon icon-dots-three-vertical"><span class="is-sr-only">Main navigation menu</div>
</label>
</div>