0
0
mirror of https://github.com/twbs/bootstrap.git synced 2024-11-29 11:24:18 +01:00

Placement auto for tooltips

This commit is contained in:
Johann-S 2017-05-24 13:48:32 +02:00
parent 460ff235fa
commit 2c72af88ee
3 changed files with 18 additions and 0 deletions

View File

@ -51,6 +51,7 @@ const Tooltip = (($) => {
}
const AttachmentMap = {
AUTO : 'auto',
TOP : 'top',
RIGHT : 'right',
BOTTOM : 'bottom',

View File

@ -28,6 +28,9 @@
<hr>
<p>
<button type="button" class="btn btn-secondary" data-toggle="tooltip" data-placement="auto" title="Tooltip on auto">
Tooltip on auto
</button>
<button type="button" class="btn btn-secondary" data-toggle="tooltip" data-placement="top" title="Tooltip on top">
Tooltip on top
</button>

View File

@ -74,6 +74,20 @@
border-left-color: $tooltip-arrow-color;
}
}
&.bs-tooltip-auto {
&[x-placement^="top"] {
@extend .bs-tooltip-top;
}
&[x-placement^="right"] {
@extend .bs-tooltip-right;
}
&[x-placement^="bottom"] {
@extend .bs-tooltip-bottom;
}
&[x-placement^="left"] {
@extend .bs-tooltip-left;
}
}
.arrow::before {
position: absolute;