Skip to content
Snippets Groups Projects
Commit de8dea17 authored by Moritz Strohm's avatar Moritz Strohm
Browse files

changed HTML of tooltips

parent 90bb9ad0
No related branches found
No related tags found
No related merge requests found
...@@ -33,7 +33,7 @@ $(document).on('mouseenter mouseleave focusin focusout', '[data-tooltip],.toolti ...@@ -33,7 +33,7 @@ $(document).on('mouseenter mouseleave focusin focusout', '[data-tooltip],.toolti
throw "Invalid content for tooltip via data"; throw "Invalid content for tooltip via data";
} }
if (!content) { if (!content) {
content = $(this).find('.tooltip-content').remove().html(); content = $(this).closest('.tooltip-content').html();
} }
$(this).attr('title', null); $(this).attr('title', null);
$(this).attr('data-tooltip', content); $(this).attr('data-tooltip', content);
......
...@@ -34,11 +34,11 @@ ...@@ -34,11 +34,11 @@
@include icon(before, info-circle, attention); @include icon(before, info-circle, attention);
} }
.tooltip-content { & + .tooltip-content {
@extend %tooltip; @extend %tooltip;
display: none; display: none;
} }
&:hover .tooltip-content { &:hover + .tooltip-content {
bottom: 100%; bottom: 100%;
display: inline-block; display: inline-block;
left: 50%; left: 50%;
......
<span class="tooltip tooltip-icon <? if ($important) echo 'tooltip-important'; ?>" <span class="tooltip tooltip-icon <? if ($important) echo 'tooltip-important'; ?>"
data-tooltip <? if (!$html) printf('title="%s"', htmlReady($text)) ?> data-tooltip <? if (!$html) printf('title="%s"', htmlReady($text)) ?>
tabindex="0" aria-describedby="tooltip_<?= htmlReady($tooltip_id) ?>"> tabindex="0" aria-describedby="tooltip_<?= htmlReady($tooltip_id) ?>">
<? if ($html): ?>
<span class="tooltip-content"><?= $text ?></span>
<? endif; ?>
</span> </span>
<span id="tooltip_<?= htmlReady($tooltip_id) ?>" class="sr-only"><?= htmlReady($text) ?></span> <span id="tooltip_<?= htmlReady($tooltip_id) ?>" class="tooltip-content"><?= htmlReady($text) ?></span>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment