aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohann-S <[email protected]>2017-05-12 21:22:12 +0200
committerJohann-S <[email protected]>2017-05-14 11:41:19 +0200
commitc78cbb275b0c559f5c9436ee3df816e1f6195201 (patch)
treed401eb5c12ee3fa3b08682ede98a68c76a8fdd33
parent2b403819b7faa07e9849885cd6ae672774e38553 (diff)
downloadbootstrap-c78cbb275b0c559f5c9436ee3df816e1f6195201.tar.xz
bootstrap-c78cbb275b0c559f5c9436ee3df816e1f6195201.zip
Change fallbackPlacement to flip by default for Tooltips/Popovers
-rw-r--r--docs/components/tooltips.md2
-rw-r--r--js/src/tooltip.js7
2 files changed, 4 insertions, 5 deletions
diff --git a/docs/components/tooltips.md b/docs/components/tooltips.md
index 7b3133c0e..5518b7140 100644
--- a/docs/components/tooltips.md
+++ b/docs/components/tooltips.md
@@ -245,7 +245,7 @@ Options can be passed via data attributes or JavaScript. For data attributes, ap
<tr>
<td>fallbackPlacement</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
Popper.js's <a href="https://popper.js.org/popper-documentation.html#modifiers..flip.behavior">behavior docs</a></td>
</tr>
diff --git a/js/src/tooltip.js b/js/src/tooltip.js
index 6d3db06ab..f447ed4ce 100644
--- a/js/src/tooltip.js
+++ b/js/src/tooltip.js
@@ -70,7 +70,7 @@ const Tooltip = (($) => {
placement : 'top',
offset : 0,
container : false,
- fallbackPlacement : [AttachmentMap.TOP, AttachmentMap.RIGHT, AttachmentMap.BOTTOM, AttachmentMap.LEFT]
+ fallbackPlacement : 'flip'
}
const HoverState = {
@@ -334,8 +334,7 @@ const Tooltip = (($) => {
$(this.tip)
.one(Util.TRANSITION_END, complete)
.emulateTransitionEnd(Tooltip._TRANSITION_DURATION)
- }
- else {
+ } else {
complete()
}
}
@@ -668,7 +667,7 @@ const Tooltip = (($) => {
const tip = this.getTipElement()
const initConfigAnimation = this.config.animation
if (tip.getAttribute('x-placement') !== null) {
- return;
+ return
}
$(tip).removeClass(ClassName.FADE)
this.config.animation = false