diff options
author | Chris Rebert <code@rebertia.com> | 2014-08-31 00:02:05 +0400 |
---|---|---|
committer | Chris Rebert <code@rebertia.com> | 2014-09-08 09:58:33 +0400 |
commit | 989dafb153c927645c1afe93c7184b535a321038 (patch) | |
tree | 0be5ddeb3f653b14057d4b32861194801476ccbe /js/tooltip.js | |
parent | fe896923fce4ec29f09055b4778ebc64eda8fccc (diff) |
Handle lack of .width and .height from getBoundingClientRect() in IE8
Closes #14093
Correction to #14090
Relevant docs: https://developer.mozilla.org/en-US/docs/Web/API/Element.getBoundingClientRect#Browser_compatibility
Diffstat (limited to 'js/tooltip.js')
-rw-r--r-- | js/tooltip.js | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/js/tooltip.js b/js/tooltip.js index e730db6e95..93e21e6919 100644 --- a/js/tooltip.js +++ b/js/tooltip.js @@ -324,6 +324,10 @@ var isSvg = window.SVGElement && el instanceof window.SVGElement var elRect = el.getBoundingClientRect() + if (elRect.width == null) { + // width and height are missing in IE8, so compute them manually; see https://github.com/twbs/bootstrap/issues/14093 + elRect = $.extend({}, elRect, { width: elRect.right - elRect.left, height: elRect.bottom - elRect.top }) + } var elOffset = isBody ? { top: 0, left: 0 } : $element.offset() var scroll = { scroll: isBody ? document.documentElement.scrollTop || document.body.scrollTop : $element.scrollTop() } var outerDims = isSvg ? {} : { |