aboutsummaryrefslogtreecommitdiff
path: root/js/tooltip.js
diff options
context:
space:
mode:
authorMark Otto <[email protected]>2014-06-08 13:57:44 -0700
committerMark Otto <[email protected]>2014-06-08 13:57:44 -0700
commitd1872b4c98f26b1bfcd7e007133b97e6602dd0d0 (patch)
treeccc12bda1d6df512fbc9c4023b296f46a6f05e3f /js/tooltip.js
parent5872a7e0aca5e2b5b8e0be5df8b2a7cdf987d805 (diff)
parent5cd72ce23058b47a739c7e2005ab5c3d4e28ff30 (diff)
downloadbootstrap-d1872b4c98f26b1bfcd7e007133b97e6602dd0d0.tar.xz
bootstrap-d1872b4c98f26b1bfcd7e007133b97e6602dd0d0.zip
Merge branch 'master' into pr/13736
Conflicts: dist/css/bootstrap.css.map dist/css/bootstrap.min.css
Diffstat (limited to 'js/tooltip.js')
-rw-r--r--js/tooltip.js15
1 files changed, 8 insertions, 7 deletions
diff --git a/js/tooltip.js b/js/tooltip.js
index f0f8a7c18..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()
@@ -199,7 +200,7 @@
this.applyPlacement(calculatedOffset, placement)
this.hoverState = null
- var complete = function() {
+ var complete = function () {
that.$element.trigger('shown.bs.' + that.type)
}
@@ -304,7 +305,7 @@
Tooltip.prototype.fixTitle = function () {
var $e = this.$element
- if ($e.attr('title') || typeof($e.attr('data-original-title')) != 'string') {
+ if ($e.attr('title') || typeof ($e.attr('data-original-title')) != 'string') {
$e.attr('data-original-title', $e.attr('title') || '').attr('title', '')
}
}
@@ -321,7 +322,7 @@
scroll: isBody ? document.documentElement.scrollTop || document.body.scrollTop : $element.scrollTop(),
width: isBody ? $(window).width() : $element.outerWidth(),
height: isBody ? $(window).height() : $element.outerHeight()
- }, isBody ? {top: 0, left: 0} : $element.offset())
+ }, isBody ? { top: 0, left: 0 } : $element.offset())
}
Tooltip.prototype.getCalculatedOffset = function (placement, pos, actualWidth, actualHeight) {
@@ -378,11 +379,11 @@
}
Tooltip.prototype.tip = function () {
- return this.$tip = this.$tip || $(this.options.template)
+ return (this.$tip = this.$tip || $(this.options.template))
}
Tooltip.prototype.arrow = function () {
- return this.$arrow = this.$arrow || this.tip().find('.tooltip-arrow')
+ return (this.$arrow = this.$arrow || this.tip().find('.tooltip-arrow'))
}
Tooltip.prototype.validate = function () {