]> git.ipfire.org Git - thirdparty/bootstrap.git/commitdiff
popover: Move common code in tooltip's `getTipElement()`
authorGeoSot <geo.sotis@gmail.com>
Thu, 10 Jun 2021 07:58:41 +0000 (10:58 +0300)
committerXhmikosR <xhmikosr@gmail.com>
Thu, 22 Jul 2021 14:20:38 +0000 (17:20 +0300)
js/src/popover.js
js/src/tooltip.js

index 5ef127b8af2edf1deb04bc767a5df5d97edee2b7..87df36086ac1ca9013efd38b94c99c43e71dc074 100644 (file)
@@ -51,9 +51,6 @@ const Event = {
   MOUSELEAVE: `mouseleave${EVENT_KEY}`
 }
 
-const CLASS_NAME_FADE = 'fade'
-const CLASS_NAME_SHOW = 'show'
-
 const SELECTOR_TITLE = '.popover-header'
 const SELECTOR_CONTENT = '.popover-body'
 
@@ -117,8 +114,6 @@ class Popover extends Tooltip {
     }
 
     this.setElementContent(SelectorEngine.findOne(SELECTOR_CONTENT, tip), content)
-
-    tip.classList.remove(CLASS_NAME_FADE, CLASS_NAME_SHOW)
   }
 
   // Private
index 5746ec6baff04c0f1eba4d40def1e62119c5a38a..fa364a1e6811229083b9b8f6acd655cdd8849375 100644 (file)
@@ -367,7 +367,10 @@ class Tooltip extends BaseComponent {
     const element = document.createElement('div')
     element.innerHTML = this._config.template
 
-    this.tip = element.children[0]
+    const tip = element.children[0]
+    tip.classList.remove(CLASS_NAME_FADE, CLASS_NAME_SHOW)
+
+    this.tip = tip
     return this.tip
   }