aboutsummaryrefslogtreecommitdiff
path: root/js/src
diff options
context:
space:
mode:
authorBardi Harborow <[email protected]>2016-11-30 04:45:14 +1100
committerMark Otto <[email protected]>2016-11-29 09:45:14 -0800
commit535fec93cf8892d1a83f6bb8cb97adc589af2b39 (patch)
treec5d93b4e401695e66a54de8af241e625c8733cd6 /js/src
parentf2bc3bec7cce34752ce27ade582dee6d3e060432 (diff)
downloadbootstrap-535fec93cf8892d1a83f6bb8cb97adc589af2b39.tar.xz
bootstrap-535fec93cf8892d1a83f6bb8cb97adc589af2b39.zip
Hide popovers when their containing modal is closed. (#21227)
Diffstat (limited to 'js/src')
-rw-r--r--js/src/tooltip.js6
1 files changed, 6 insertions, 0 deletions
diff --git a/js/src/tooltip.js b/js/src/tooltip.js
index dbc9cf18c..2b659b885 100644
--- a/js/src/tooltip.js
+++ b/js/src/tooltip.js
@@ -224,6 +224,7 @@ const Tooltip = (($) => {
$.removeData(this.element, this.constructor.DATA_KEY)
$(this.element).off(this.constructor.EVENT_KEY)
+ $(this.element).closest('.modal').off('hide.bs.modal')
if (this.tip) {
$(this.tip).remove()
@@ -454,6 +455,11 @@ const Tooltip = (($) => {
(event) => this._leave(event)
)
}
+
+ $(this.element).closest('.modal').on(
+ 'hide.bs.modal',
+ () => this.hide()
+ )
})
if (this.config.selector) {