Skip to content
Snippets Groups Projects
Commit 0623b6ac authored by Moritz Strohm's avatar Moritz Strohm Committed by Jan-Hendrik Willms
Browse files

added tabindex for tooltips generated by tooltip2 or tooltipIcon functions

parent c7acb138
No related branches found
No related tags found
No related merge requests found
......@@ -623,6 +623,7 @@ function tooltip2($text, $with_alt = TRUE, $with_popup = FALSE) {
$ret['alt'] = $text;
}
$ret['title'] = $text;
$ret['tabindex'] = '0';
return $ret;
}
......
......@@ -10,10 +10,10 @@ var timeout = null;
STUDIP.Tooltip.threshold = 6;
$(document).on('mouseenter mouseleave', '[data-tooltip],.tooltip:has(.tooltip-content)', function(event) {
$(document).on('mouseenter mouseleave focusin focusout', '[data-tooltip],.tooltip:has(.tooltip-content)', function(event) {
let data = $(this).data();
const visible = event.type === 'mouseenter';
const visible = event.type === 'mouseenter' || event.type === 'focusin';
const offset = $(this).offset();
const x = offset.left + $(this).outerWidth(true) / 2;
const y = offset.top;
......@@ -61,8 +61,8 @@ $(document).on('mouseenter mouseleave', '[data-tooltip],.tooltip:has(.tooltip-co
} else {
timeout = setTimeout(() => data.tooltipObject.hide(), delay);
}
}).on('mouseenter', '.studip-tooltip', () => {
}).on('mouseenter focusin', '.studip-tooltip', () => {
clearTimeout(timeout);
}).on('mouseleave', '.studip-tooltip', function() {
}).on('mouseleave focusout', '.studip-tooltip', function() {
$(this).hide();
});
<span class="tooltip tooltip-icon <? if ($important) echo 'tooltip-important'; ?>" data-tooltip <? if (!$html) printf('title="%s"', htmlReady($text)) ?>>
<span class="tooltip tooltip-icon <? if ($important) echo 'tooltip-important'; ?>" data-tooltip <? if (!$html) printf('title="%s"', htmlReady($text)) ?> tabindex="0">
<? if ($html): ?>
<span class="tooltip-content"><?= $text ?></span>
<? endif; ?>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment