mirror of
https://codeberg.org/rimu/pyfedi
synced 2025-01-24 03:43:42 -08:00
add aria-expanded when mobile nav shown
This commit is contained in:
parent
61830e630c
commit
394f46fde3
2 changed files with 5 additions and 2 deletions
|
@ -23,8 +23,11 @@ window.addEventListener("load", function () {
|
||||||
|
|
||||||
function setupMobileNav() {
|
function setupMobileNav() {
|
||||||
var navbarToggler = document.getElementById('navbar-toggler');
|
var navbarToggler = document.getElementById('navbar-toggler');
|
||||||
|
var navbarSupportedContent = document.getElementById('navbarSupportedContent');
|
||||||
navbarToggler.addEventListener("click", function(event) {
|
navbarToggler.addEventListener("click", function(event) {
|
||||||
toggleClass('navbarSupportedContent', 'show_menu')
|
toggleClass('navbarSupportedContent', 'show_menu');
|
||||||
|
var isExpanded = navbarSupportedContent.classList.contains('show_menu');
|
||||||
|
navbarSupportedContent.setAttribute('aria-expanded', isExpanded ? 'true' : 'false');
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -116,7 +116,7 @@
|
||||||
<span class="navbar-toggler-icon"></span>
|
<span class="navbar-toggler-icon"></span>
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
<div class="collapse navbar-collapse" id="navbarSupportedContent" role="navigation">
|
<div class="collapse navbar-collapse" id="navbarSupportedContent" role="navigation" aria-expanded="false">
|
||||||
<ul class="nav navbar-nav ml-md-4">
|
<ul class="nav navbar-nav ml-md-4">
|
||||||
{% if current_user.is_anonymous %}
|
{% if current_user.is_anonymous %}
|
||||||
<li class="nav-item dropdown{% if active_parent == 'home' %} active{% endif %}">
|
<li class="nav-item dropdown{% if active_parent == 'home' %} active{% endif %}">
|
||||||
|
|
Loading…
Add table
Reference in a new issue