From: Johann-S Date: Thu, 13 Jun 2019 08:43:27 +0000 (+0200) Subject: tooltip dispose:removing only own event handler (#28896) X-Git-Tag: v4.4.0~143 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6c9f833a907a8e293f567af48c37c355f1ba867d;p=thirdparty%2Fbootstrap.git tooltip dispose:removing only own event handler (#28896) --- diff --git a/js/src/tooltip.js b/js/src/tooltip.js index 81a2dedc6c..b200656658 100644 --- a/js/src/tooltip.js +++ b/js/src/tooltip.js @@ -226,7 +226,7 @@ class Tooltip { $.removeData(this.element, this.constructor.DATA_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) { $(this.tip).remove() @@ -535,13 +535,15 @@ class Tooltip { } }) + this._hideModalHandler = () => { + if (this.element) { + this.hide() + } + } + $(this.element).closest('.modal').on( 'hide.bs.modal', - () => { - if (this.element) { - this.hide() - } - } + this._hideModalHandler ) if (this.config.selector) {