Change fallbackPlacement to flip by default for Tooltips/Popovers

This commit is contained in:
Johann-S 2017-05-12 21:22:12 +02:00
parent 2b403819b7
commit c78cbb275b
2 changed files with 4 additions and 5 deletions

View File

@ -245,7 +245,7 @@ Options can be passed via data attributes or JavaScript. For data attributes, ap
<tr> <tr>
<td>fallbackPlacement</td> <td>fallbackPlacement</td>
<td>string | array</td> <td>string | array</td>
<td>['top', 'right', 'bottom', 'left']</td> <td>'flip'</td>
<td>Allow to specify which position Popper will use on fallback. For more information refer to <td>Allow to specify which position Popper will use on fallback. For more information refer to
Popper.js's <a href="https://popper.js.org/popper-documentation.html#modifiers..flip.behavior">behavior docs</a></td> Popper.js's <a href="https://popper.js.org/popper-documentation.html#modifiers..flip.behavior">behavior docs</a></td>
</tr> </tr>

View File

@ -70,7 +70,7 @@ const Tooltip = (($) => {
placement : 'top', placement : 'top',
offset : 0, offset : 0,
container : false, container : false,
fallbackPlacement : [AttachmentMap.TOP, AttachmentMap.RIGHT, AttachmentMap.BOTTOM, AttachmentMap.LEFT] fallbackPlacement : 'flip'
} }
const HoverState = { const HoverState = {
@ -334,8 +334,7 @@ const Tooltip = (($) => {
$(this.tip) $(this.tip)
.one(Util.TRANSITION_END, complete) .one(Util.TRANSITION_END, complete)
.emulateTransitionEnd(Tooltip._TRANSITION_DURATION) .emulateTransitionEnd(Tooltip._TRANSITION_DURATION)
} } else {
else {
complete() complete()
} }
} }
@ -668,7 +667,7 @@ const Tooltip = (($) => {
const tip = this.getTipElement() const tip = this.getTipElement()
const initConfigAnimation = this.config.animation const initConfigAnimation = this.config.animation
if (tip.getAttribute('x-placement') !== null) { if (tip.getAttribute('x-placement') !== null) {
return; return
} }
$(tip).removeClass(ClassName.FADE) $(tip).removeClass(ClassName.FADE)
this.config.animation = false this.config.animation = false