0
0
mirror of https://github.com/twbs/bootstrap.git synced 2025-03-15 15:29:22 +01:00

tooltip dispose:removing only own event handler (#28896)

This commit is contained in:
Johann-S 2019-06-13 10:43:27 +02:00 committed by XhmikosR
parent 24abed1336
commit 6c9f833a90

View File

@ -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.element).closest('.modal').on( this._hideModalHandler = () => {
'hide.bs.modal',
() => {
if (this.element) { if (this.element) {
this.hide() this.hide()
} }
} }
$(this.element).closest('.modal').on(
'hide.bs.modal',
this._hideModalHandler
) )
if (this.config.selector) { if (this.config.selector) {