Skip to content
Snippets Groups Projects
Commit aea383ff authored by Elmar Ludwig's avatar Elmar Ludwig Committed by David Siegfried
Browse files

add aria role for JS tooltips, fixes #1916

Closes #1916

Merge request studip/studip!1314
parent 29604e0e
No related branches found
No related tags found
No related merge requests found
......@@ -35,12 +35,13 @@ $(document).on('mouseenter mouseleave focusin focusout', '[data-tooltip],.toolti
if (!content) {
content = $(this).find('.tooltip-content').remove().html();
}
$(this).attr('title', '');
$(this).attr('title', null);
$(this).attr('data-tooltip', content);
tooltip = new STUDIP.Tooltip(x, y, content);
data.tooltipObject = tooltip;
$(this).attr('aria-describedby', tooltip.id);
$(this).on('remove', function() {
tooltip.remove();
......
......@@ -66,6 +66,7 @@ class Tooltip {
this.element = $('<div>');
this.element.addClass(css_class || 'studip-tooltip');
this.element.attr('id', this.id);
this.element.attr('role', 'tooltip');
this.element.appendTo('body');
// Set position and content and paint the tooltip
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment