1
0
mirror of https://github.com/twbs/bootstrap.git synced 2025-08-11 08:04:59 +02:00

tooltip: move repeated strings to constants (#34619)

This commit is contained in:
XhmikosR
2021-07-30 01:32:07 +03:00
committed by GitHub
parent 6d707f4801
commit 742269a734

View File

@@ -108,6 +108,9 @@ const HOVER_STATE_SHOW = 'show'
const HOVER_STATE_OUT = 'out' const HOVER_STATE_OUT = 'out'
const SELECTOR_TOOLTIP_INNER = '.tooltip-inner' 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_HOVER = 'hover'
const TRIGGER_FOCUS = 'focus' const TRIGGER_FOCUS = 'focus'
@@ -202,7 +205,7 @@ class Tooltip extends BaseComponent {
dispose() { dispose() {
clearTimeout(this._timeout) 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) { if (this.tip) {
this.tip.remove() 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) { if (this._config.selector) {
this._config = { this._config = {