aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Rebert <[email protected]>2014-06-06 15:34:56 -0700
committerChris Rebert <[email protected]>2014-06-07 17:54:11 -0700
commit21de05c8c09b0ff9c11651596a84442b312381bb (patch)
treed42ee22fd834c0cc7bcad42f288e3d09a72d2917
parentb23ed1b034caa90a4f6d0f97674022c80126d078 (diff)
downloadbootstrap-21de05c8c09b0ff9c11651596a84442b312381bb.tar.xz
bootstrap-21de05c8c09b0ff9c11651596a84442b312381bb.zip
don't show tooltips/popovers whose element isn't in the DOM; fixes #13268
-rw-r--r--js/tooltip.js5
1 files changed, 3 insertions, 2 deletions
diff --git a/js/tooltip.js b/js/tooltip.js
index 3b8ac17f6..b4ced6d2a 100644
--- a/js/tooltip.js
+++ b/js/tooltip.js
@@ -145,8 +145,9 @@
if (this.hasContent() && this.enabled) {
this.$element.trigger(e)
- if (e.isDefaultPrevented()) return
- var that = this;
+ var inDom = $.contains(document.documentElement, this.$element[0])
+ if (e.isDefaultPrevented() || !inDom) return
+ var that = this
var $tip = this.tip()