aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXhmikosR <[email protected]>2021-07-30 01:32:07 +0300
committerGitHub <[email protected]>2021-07-30 00:32:07 +0200
commit742269a73494300c149ca916328f3762cae616cc (patch)
tree4f94238f00eca015dd2434d73dfdcd8fa71b81ec
parent6d707f4801750f1454351d6afe93a80ce4516d1a (diff)
downloadbootstrap-742269a73494300c149ca916328f3762cae616cc.tar.xz
bootstrap-742269a73494300c149ca916328f3762cae616cc.zip
tooltip: move repeated strings to constants (#34619)
-rw-r--r--js/src/tooltip.js7
1 files changed, 5 insertions, 2 deletions
diff --git a/js/src/tooltip.js b/js/src/tooltip.js
index 0adde623f..f932a9ff9 100644
--- a/js/src/tooltip.js
+++ b/js/src/tooltip.js
@@ -108,6 +108,9 @@ const HOVER_STATE_SHOW = 'show'
const HOVER_STATE_OUT = 'out'
const SELECTOR_TOOLTIP_INNER = '.tooltip-inner'
+const SELECTOR_MODAL = `.${CLASS_NAME_MODAL}`
+
+const EVENT_MODAL_HIDE = 'hide.bs.modal'
const TRIGGER_HOVER = 'hover'
const TRIGGER_FOCUS = 'focus'
@@ -202,7 +205,7 @@ class Tooltip extends BaseComponent {
dispose() {
clearTimeout(this._timeout)
- EventHandler.off(this._element.closest(`.${CLASS_NAME_MODAL}`), 'hide.bs.modal', this._hideModalHandler)
+ EventHandler.off(this._element.closest(SELECTOR_MODAL), EVENT_MODAL_HIDE, this._hideModalHandler)
if (this.tip) {
this.tip.remove()
@@ -545,7 +548,7 @@ class Tooltip extends BaseComponent {
}
}
- EventHandler.on(this._element.closest(`.${CLASS_NAME_MODAL}`), 'hide.bs.modal', this._hideModalHandler)
+ EventHandler.on(this._element.closest(SELECTOR_MODAL), EVENT_MODAL_HIDE, this._hideModalHandler)
if (this._config.selector) {
this._config = {