Skip to content
Snippets Groups Projects
Commit 2c31279a authored by Jan-Hendrik Willms's avatar Jan-Hendrik Willms Committed by David Siegfried
Browse files

add tooltip content as aria label, fixes #1916

Closes #1916

Merge request studip/studip!1267
parent 43cef13c
No related branches found
No related tags found
No related merge requests found
...@@ -37,6 +37,7 @@ $(document).on('mouseenter mouseleave focusin focusout', '[data-tooltip],.toolti ...@@ -37,6 +37,7 @@ $(document).on('mouseenter mouseleave focusin focusout', '[data-tooltip],.toolti
} }
$(this).attr('title', ''); $(this).attr('title', '');
$(this).attr('data-tooltip', content); $(this).attr('data-tooltip', content);
$(this).attr('aria-label', content);
tooltip = new STUDIP.Tooltip(x, y, content); tooltip = new STUDIP.Tooltip(x, y, content);
......
...@@ -87,6 +87,7 @@ class Tooltip { ...@@ -87,6 +87,7 @@ class Tooltip {
* *
* @param {int} x - Horizontal offset * @param {int} x - Horizontal offset
* @param {int} y - Vertical offset * @param {int} y - Vertical offset
* @param {bool} left_arrow - Vertical offset
*/ */
translateArrows(x, y, left_arrow = false) { translateArrows(x, y, left_arrow = false) {
CSS.removeRule(`#${this.id}::before`); CSS.removeRule(`#${this.id}::before`);
......
<?php
/**
* @var bool $html
* @var bool $important
* @var string $text
*/
?>
<span class="tooltip tooltip-icon <? if ($important) echo 'tooltip-important'; ?>" data-tooltip <? if (!$html) printf('title="%s"', htmlReady($text)) ?> tabindex="0"> <span class="tooltip tooltip-icon <? if ($important) echo 'tooltip-important'; ?>" data-tooltip <? if (!$html) printf('title="%s"', htmlReady($text)) ?> tabindex="0">
<? if ($html): ?> <? if ($html): ?>
<span class="tooltip-content"><?= $text ?></span> <span class="tooltip-content"><?= $text ?></span>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment