Adding WAI-ARIA attributes to the header dropdown (Fix by Aleksej Serdjukov)

This fixes issue #754

Thanks Aleksej!
This commit is contained in:
Christopher Allan Webber 2014-07-10 10:22:33 -05:00
parent a433775536
commit 4b24678a1f
3 changed files with 15 additions and 9 deletions

View File

@ -132,17 +132,17 @@ header {
line-height: 1.6em;
}
.header_dropdown {
#header_dropdown {
margin-bottom: 20px;
padding: 0px 10px 0px 10px;
}
.header_dropdown li {
#header_dropdown li {
margin: 4px 0;
list-style: none;
}
.header_dropdown p {
#header_dropdown p {
margin-top: 12px;
margin-bottom: 10px;
}

View File

@ -17,11 +17,11 @@
*/
$(document).ready(function(){
$(".header_dropdown").hide();
$("#header_dropdown").hide();
$(".header_dropdown_up").hide();
$(".header_dropdown_down,.header_dropdown_up").click(function() {
$(".header_dropdown_down").toggle();
$(".header_dropdown_up").toggle();
$(".header_dropdown").slideToggle();
$("#header_dropdown").slideToggle();
});
});

View File

@ -78,11 +78,17 @@
{% set notification_count = get_notification_count(request.user.id) %}
{% if notification_count %}
<a href="javascript:;" class="notification-gem button_action button_info" title="Notifications">
<a href="javascript:;"
class="notification-gem button_action button_info"
title="Notifications">
{{ notification_count }}</a>
{% endif %}
<a href="javascript:;" class="button_action header_dropdown_down">&#9660;</a>
<a href="javascript:;" class="button_action header_dropdown_up">&#9650;</a>
<a href="javascript:;"
class="button_action header_dropdown_down"
aria-controls="header_dropdown">&#9660;</a>
<a href="javascript:;"
class="button_action header_dropdown_up"
aria-controls="header_dropdown">&#9650;</a>
{% elif request.user and not request.user.has_privilege('active') %}
{# the following link should only appear when verification is needed #}
<a href="{{ request.urlgen('mediagoblin.user_pages.user_home',
@ -119,7 +125,7 @@
</div>
<div class="clear"></div>
{% if request.user and request.user.has_privilege('active') %}
<div class="header_dropdown">
<div id="header_dropdown">
<p>
<span class="dropdown_title">
{% trans user_url=request.urlgen('mediagoblin.user_pages.user_home',