diff --git a/resources/assets/javascripts/bootstrap/tooltip.js b/resources/assets/javascripts/bootstrap/tooltip.js index 2c87cbd3bdc382c189061acaaa189206d012d5f6..02520e779a0c288a4218988e7a50d8da106e0497 100644 --- a/resources/assets/javascripts/bootstrap/tooltip.js +++ b/resources/assets/javascripts/bootstrap/tooltip.js @@ -7,29 +7,3 @@ var timeout = null; STUDIP.Tooltip.threshold = 6; -/* -$(document).on('mouseenter mouseleave focusin focusout', '[data-tooltip],.tooltip:has(.tooltip-content)', function(event) { - let data = $(this).data(); - const visible = event.type === 'mouseenter' || event.type === 'focusin'; - const offset = $(this).offset(); - const x = offset.left + $(this).outerWidth(true) / 2; - const y = offset.top; - const delay = data.tooltipDelay ?? 300; - - if (!data.tooltipObject) { - data.tooltipObject = new STUDIP.Tooltip(x, y, $(this).children('.tooltip-content').first().html()); - } - - if (visible) { - // If tooltip has already been created, update its position. - // This is necessary if the surrounding content is scrollable AND has - // been scrolled. Otherwise, the tooltip would appear at its previous - // and now wrong location. - data.tooltipObject.position(x, y); - } -}).on('mouseenter focusin', '.studip-tooltip', () => { - clearTimeout(timeout); -}).on('mouseleave focusout', '.studip-tooltip', function() { - $(this).hide(); -}); -*/ diff --git a/resources/assets/stylesheets/scss/tooltip.scss b/resources/assets/stylesheets/scss/tooltip.scss index a25d9918f497684fe8de342c669fdf0b99b64c1c..d927344f09592d8d055fd7e6720b60e0eb2c7f77 100644 --- a/resources/assets/stylesheets/scss/tooltip.scss +++ b/resources/assets/stylesheets/scss/tooltip.scss @@ -43,7 +43,7 @@ bottom: 100%; display: inline-block; left: 50%; - margin-left: -($grid-element-width) / 2 - 10px; + margin-left: - calc($grid-element-width / 2) - 10px; width: $grid-element-width; } } diff --git a/templates/shared/tooltip.php b/templates/shared/tooltip.php index 89b09da29503a2ed5ec8bbbdeec8a7497e7dd9c5..8dbcd382421175fd5bd6b69a1e7a3690144d90f8 100644 --- a/templates/shared/tooltip.php +++ b/templates/shared/tooltip.php @@ -1,4 +1,4 @@ <span class="tooltip tooltip-icon <? if ($important) echo 'tooltip-important'; ?>" - tabindex="0"> + tabindex="0" aria-label="<?= $html ? kill_format($text) : htmlReady($text) ?>"> <span class="tooltip-content"><?= $html ? $text : htmlReady($text) ?></span> </span>