toodego: a11y, add explicit links for toggling group titles (#34678)
This commit is contained in:
parent
7e9072d4c5
commit
0709780110
|
@ -203,6 +203,14 @@ div.cell h2 {
|
|||
span.remove::after {
|
||||
content: "\f00d"; /* times */
|
||||
}
|
||||
a.a11y-toggle-link {
|
||||
position: absolute;
|
||||
right: 5px;
|
||||
top: 5px;
|
||||
bottom: 5px;
|
||||
width: 40px;
|
||||
display: block;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -215,6 +223,9 @@ div.cell h2 {
|
|||
pointer-events: all;
|
||||
opacity: 1;
|
||||
}
|
||||
a.a11y-toggle-link {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -933,4 +933,19 @@ $(function() {
|
|||
init_gallery_cell();
|
||||
}
|
||||
});
|
||||
|
||||
function init_group_titles_for_a11y() {
|
||||
$('.group-title h2').each(function(idx, elem) {
|
||||
if ($(elem).find('.a11y-toggle-link').length) return;
|
||||
$(elem).append('<a class="a11y-toggle-link" href=""><span class="sr-only">plier/déplier la section</span></a>')
|
||||
});
|
||||
}
|
||||
init_group_titles_for_a11y();
|
||||
|
||||
$(document).on('combo:cell-loaded', function(ev, elem) {
|
||||
if ($(elem).find('.group-title')) {
|
||||
init_group_titles_for_a11y();
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue