From 21de05c8c09b0ff9c11651596a84442b312381bb Mon Sep 17 00:00:00 2001 From: Chris Rebert Date: Fri, 6 Jun 2014 15:34:56 -0700 Subject: [PATCH] don't show tooltips/popovers whose element isn't in the DOM; fixes #13268 --- js/tooltip.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/js/tooltip.js b/js/tooltip.js index 3b8ac17f6d..b4ced6d2af 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() -- 2.47.2