Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/twbs/bootstrap.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/js/src
diff options
context:
space:
mode:
authorGeoSot <geo.sotis@gmail.com>2021-06-10 10:58:41 +0300
committerXhmikosR <xhmikosr@gmail.com>2021-07-22 17:20:38 +0300
commit9c3ceaa25b0fcb9b5bd9ff688235e4f3b741026a (patch)
tree5e50c9660ea072ae64e4aaa8ce7d1bc603c5aef3 /js/src
parenta97fd1cd2420a4c07589689593385484bd38fb50 (diff)
popover: Move common code in tooltip's `getTipElement()`
Diffstat (limited to 'js/src')
-rw-r--r--js/src/popover.js5
-rw-r--r--js/src/tooltip.js5
2 files changed, 4 insertions, 6 deletions
diff --git a/js/src/popover.js b/js/src/popover.js
index 5ef127b8af..87df36086a 100644
--- a/js/src/popover.js
+++ b/js/src/popover.js
@@ -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
diff --git a/js/src/tooltip.js b/js/src/tooltip.js
index 5746ec6baf..fa364a1e68 100644
--- a/js/src/tooltip.js
+++ b/js/src/tooltip.js
@@ -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
}