]> git.ipfire.org Git - thirdparty/bootstrap.git/commitdiff
Change fallbackPlacement to flip by default for Tooltips/Popovers
authorJohann-S <johann.servoire@gmail.com>
Fri, 12 May 2017 19:22:12 +0000 (21:22 +0200)
committerJohann-S <johann.servoire@gmail.com>
Sun, 14 May 2017 09:41:19 +0000 (11:41 +0200)
docs/components/tooltips.md
js/src/tooltip.js

index 7b3133c0e2931b90c7a04a596a035ae36f339a78..5518b7140b928defe1831d0d17a17f4e55c0e0c4 100644 (file)
@@ -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>
index 6d3db06ab9b6d6e674b125ac72a8ad6cac00b414..f447ed4cedf2cca589a305e0938012fcb9785799 100644 (file)
@@ -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