]> git.ipfire.org Git - thirdparty/bootstrap.git/commitdiff
Hide popovers when their containing modal is closed. (#21227)
authorBardi Harborow <bardi@bardiharborow.com>
Tue, 29 Nov 2016 17:45:14 +0000 (04:45 +1100)
committerMark Otto <markd.otto@gmail.com>
Tue, 29 Nov 2016 17:45:14 +0000 (09:45 -0800)
js/src/tooltip.js

index dbc9cf18c36ddbd2877249ad179aaa1123709a8e..2b659b88540316dad8c2f5799b34725f69ad00b3 100644 (file)
@@ -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) {