aboutsummaryrefslogtreecommitdiff
path: root/js/src/tooltip.js
diff options
context:
space:
mode:
authorSparks <[email protected]>2020-03-09 16:26:29 +0100
committerGitHub <[email protected]>2020-03-09 17:26:29 +0200
commitc47547cd091fcb921386913ed7c0d72efd762938 (patch)
treee8ae3bb9d00d041b7381b2be0b656bdb8064da2e /js/src/tooltip.js
parent7d8c7c4ba844f3e70b7cda20a5b813b54e43959d (diff)
downloadbootstrap-c47547cd091fcb921386913ed7c0d72efd762938.tar.xz
bootstrap-c47547cd091fcb921386913ed7c0d72efd762938.zip
Improvement: harmonize usage of constants (#30285)
Diffstat (limited to 'js/src/tooltip.js')
-rw-r--r--js/src/tooltip.js5
1 files changed, 3 insertions, 2 deletions
diff --git a/js/src/tooltip.js b/js/src/tooltip.js
index 1bc000d2c..9b2ae6f61 100644
--- a/js/src/tooltip.js
+++ b/js/src/tooltip.js
@@ -109,6 +109,7 @@ const Event = {
const ClassName = {
FADE: 'fade',
+ MODAL: 'modal',
SHOW: 'show'
}
@@ -235,7 +236,7 @@ class Tooltip {
Data.removeData(this.element, this.constructor.DATA_KEY)
EventHandler.off(this.element, this.constructor.EVENT_KEY)
- EventHandler.off(SelectorEngine.closest(this.element, '.modal'), 'hide.bs.modal', this._hideModalHandler)
+ EventHandler.off(SelectorEngine.closest(this.element, `.${ClassName.MODAL}`), 'hide.bs.modal', this._hideModalHandler)
if (this.tip) {
this.tip.parentNode.removeChild(this.tip)
@@ -565,7 +566,7 @@ class Tooltip {
}
}
- EventHandler.on(SelectorEngine.closest(this.element, '.modal'),
+ EventHandler.on(SelectorEngine.closest(this.element, `.${ClassName.MODAL}`),
'hide.bs.modal',
this._hideModalHandler
)