aboutsummaryrefslogtreecommitdiff
path: root/js/src/tooltip.js
diff options
context:
space:
mode:
authordavid-lallement <[email protected]>2019-06-13 10:42:54 +0200
committerJohann-S <[email protected]>2019-06-13 10:42:54 +0200
commit0829decce075e190c0bb6e9992ca2a1ca56c60c7 (patch)
treedcdbba825113b6dc35bc1f48fcba95b72881e648 /js/src/tooltip.js
parent2ac2a5a91e2958a367c46a61d05162f640457db5 (diff)
downloadbootstrap-0829decce075e190c0bb6e9992ca2a1ca56c60c7.tar.xz
bootstrap-0829decce075e190c0bb6e9992ca2a1ca56c60c7.zip
tooltip dispose:removing only own event handler (#28896)
Diffstat (limited to 'js/src/tooltip.js')
-rw-r--r--js/src/tooltip.js14
1 files changed, 8 insertions, 6 deletions
diff --git a/js/src/tooltip.js b/js/src/tooltip.js
index 7b792bc71..6cca7d75a 100644
--- a/js/src/tooltip.js
+++ b/js/src/tooltip.js
@@ -237,7 +237,7 @@ class Tooltip {
Data.removeData(this.element, this.constructor.DATA_KEY)
EventHandler.off(this.element, this.constructor.EVENT_KEY)
- EventHandler.off(SelectorEngine.closest(this.element, '.modal'), 'hide.bs.modal')
+ EventHandler.off(SelectorEngine.closest(this.element, '.modal'), 'hide.bs.modal', this._hideModalHandler)
if (this.tip) {
this.tip.parentNode.removeChild(this.tip)
@@ -558,13 +558,15 @@ class Tooltip {
}
})
+ this._hideModalHandler = () => {
+ if (this.element) {
+ this.hide()
+ }
+ }
+
EventHandler.on(SelectorEngine.closest(this.element, '.modal'),
'hide.bs.modal',
- () => {
- if (this.element) {
- this.hide()
- }
- }
+ this._hideModalHandler
)
if (this.config.selector) {