tooltip: move repeated strings to constants
This commit is contained in:
parent
1798dfcce7
commit
98e9388800
1 changed files with 5 additions and 2 deletions
|
|
@ -111,6 +111,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'
|
||||
|
|
@ -220,7 +223,7 @@ class Tooltip extends BaseComponent {
|
|||
clearTimeout(this._timeout)
|
||||
|
||||
EventHandler.off(this._element, this.constructor.EVENT_KEY)
|
||||
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.parentNode) {
|
||||
this.tip.parentNode.removeChild(this.tip)
|
||||
|
|
@ -560,7 +563,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 = {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue