diff options
| author | Heinrich Fenkart <[email protected]> | 2014-09-11 23:11:45 +0200 |
|---|---|---|
| committer | Heinrich Fenkart <[email protected]> | 2014-09-11 23:11:45 +0200 |
| commit | 6e206f5e8f3efbd80ade3d6e9109a7f7db312d8c (patch) | |
| tree | 2ed392809927981323e5516bbc37a80042e669c0 | |
| parent | 97027a2f6fad00c4d74fbef5aef6cccb179f8229 (diff) | |
| parent | 989dafb153c927645c1afe93c7184b535a321038 (diff) | |
| download | bootstrap-6e206f5e8f3efbd80ade3d6e9109a7f7db312d8c.tar.xz bootstrap-6e206f5e8f3efbd80ade3d6e9109a7f7db312d8c.zip | |
Merge pull request #14492 from twbs/ie8-getBoundingClientRect
Handle lack of .width and .height from getBoundingClientRect() in IE8
| -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 aa6202f50..5192d38fc 100644 --- a/js/tooltip.js +++ b/js/tooltip.js @@ -329,6 +329,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 ? {} : { |
