tooltip dispose:removing only own event handler (#28896)
This commit is contained in:
parent
24abed1336
commit
6c9f833a90
1 changed files with 8 additions and 6 deletions
|
|
@ -226,7 +226,7 @@ class Tooltip {
|
||||||
$.removeData(this.element, this.constructor.DATA_KEY)
|
$.removeData(this.element, this.constructor.DATA_KEY)
|
||||||
|
|
||||||
$(this.element).off(this.constructor.EVENT_KEY)
|
$(this.element).off(this.constructor.EVENT_KEY)
|
||||||
$(this.element).closest('.modal').off('hide.bs.modal')
|
$(this.element).closest('.modal').off('hide.bs.modal', this._hideModalHandler)
|
||||||
|
|
||||||
if (this.tip) {
|
if (this.tip) {
|
||||||
$(this.tip).remove()
|
$(this.tip).remove()
|
||||||
|
|
@ -535,13 +535,15 @@ class Tooltip {
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
this._hideModalHandler = () => {
|
||||||
|
if (this.element) {
|
||||||
|
this.hide()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$(this.element).closest('.modal').on(
|
$(this.element).closest('.modal').on(
|
||||||
'hide.bs.modal',
|
'hide.bs.modal',
|
||||||
() => {
|
this._hideModalHandler
|
||||||
if (this.element) {
|
|
||||||
this.hide()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
)
|
)
|
||||||
|
|
||||||
if (this.config.selector) {
|
if (this.config.selector) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue