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:
parent
460ff235fa
commit
2c72af88ee
@ -51,6 +51,7 @@ const Tooltip = (($) => {
|
||||
}
|
||||
|
||||
const AttachmentMap = {
|
||||
AUTO : 'auto',
|
||||
TOP : 'top',
|
||||
RIGHT : 'right',
|
||||
BOTTOM : 'bottom',
|
||||
|
@ -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>
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user