Skip to content

Commit

Permalink
Handle lack of .width and .height from getBoundingClientRect() in IE8
Browse files Browse the repository at this point in the history
  • Loading branch information
cvrebert committed Sep 8, 2014
1 parent fe89692 commit 989dafb
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions js/tooltip.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 })

This comment has been minimized.

Copy link
@vsn4ik

vsn4ik Sep 11, 2014

Contributor

This string equivalent $.extend(elRect, { width: elRect.right - elRect.left, height: elRect.bottom - elRect.top })

This comment has been minimized.

Copy link
@hnrch02

hnrch02 Sep 11, 2014

Collaborator

No, see #14492 (comment) and the following screenshot:
Screenshot

}
var elOffset = isBody ? { top: 0, left: 0 } : $element.offset()
var scroll = { scroll: isBody ? document.documentElement.scrollTop || document.body.scrollTop : $element.scrollTop() }
var outerDims = isSvg ? {} : {
Expand Down

0 comments on commit 989dafb

Please sign in to comment.