Skip to content

Commit 3d20430

Browse files
committed
a11y: #4225 olh nav add aria markup to dropdowns
1 parent de9019c commit 3d20430

File tree

1 file changed

+24
-6
lines changed

1 file changed

+24
-6
lines changed

src/themes/OLH/templates/core/nav.html

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,14 @@
2121
{% for item in navigation_items %}
2222
{% if item.has_sub_nav %}
2323
<li class="is-dropdown-submenu-parent">
24-
<a href="#" data-options="is_hover:true; hover_timeout:5000">{{ item.link_name }}</a>
25-
<ul class="menu vertical medium-horizontal">
24+
<a href="#" data-options="is_hover:true; hover_timeout:5000"
25+
role="button"
26+
aria-expanded="true"
27+
aria-controls="menu-nav-item-{{ item.counter }}"
28+
>
29+
{{ item.link_name }}
30+
</a>
31+
<ul class="menu vertical medium-horizontal" id="menu-nav-item-{{ item.counter }}">
2632
{% if item.link %}
2733
<li>
2834
<a href="{{ item.url }}">{{ item.link_name }}</a>
@@ -57,8 +63,14 @@
5763
{% if journal_settings.general.enable_editorial_display %}
5864
{% if journal_settings.general.multi_page_editorial %}
5965
<li class="is-dropdown-submenu-parent">
60-
<a href="#" data-options="is_hover:true; hover_timeout:5000">{{ journal_settings.styling.editorial_group_page_name }}</a>
61-
<ul class="menu vertical medium-horizontal">
66+
<a href="#" data-options="is_hover:true; hover_timeout:5000"
67+
role="button"
68+
aria-expanded="true"
69+
aria-controls="menu-nav-journal"
70+
>
71+
{{ journal_settings.styling.editorial_group_page_name }}
72+
</a>
73+
<ul class="menu vertical medium-horizontal" id="menu-nav-journal">
6274
{% for group in request.journal.editorial_groups %}
6375
<li>
6476
<a href="{% url 'editorial_team_group' group.pk %}">{{ group.name }}</a>
@@ -105,8 +117,14 @@
105117
{% endif %}
106118

107119
<li class="is-dropdown-submenu-parent show-for-small-only">
108-
<a href="#" data-options="is_hover:true; hover_timeout:5000">{% trans 'Account' %}</a>
109-
<ul class="menu vertical medium-horizontal">
120+
<a href="#" data-options="is_hover:true; hover_timeout:5000"
121+
role="button"
122+
aria-expanded="true"
123+
aria-controls="menu-nav-account"
124+
>
125+
{% trans 'Account' %}
126+
</a>
127+
<ul class="menu vertical medium-horizontal" id="menu-nav-account">
110128
{% if request.user.is_authenticated %}
111129
<li>
112130
<a href="{% url 'core_dashboard' %}">{% trans 'Dashboard' %}</a>

0 commit comments

Comments
 (0)