]> git.ipfire.org Git - thirdparty/bootstrap.git/commitdiff
tooltip dispose:removing only own event handler (#28896)
authorJohann-S <johann.servoire@gmail.com>
Thu, 13 Jun 2019 08:43:27 +0000 (10:43 +0200)
committerXhmikosR <xhmikosr@gmail.com>
Tue, 18 Jun 2019 12:02:58 +0000 (15:02 +0300)
js/src/tooltip.js

index 81a2dedc6c6bded43f0c78fa3393754a0dfa6eb3..b200656658a60dec19827524674a706ef8b6d9a5 100644 (file)
@@ -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) {