mirror of
https://github.com/twbs/bootstrap.git
synced 2025-09-26 05:19:15 +02:00
Tooltip: Rely on getBoundingClientRect
for width
and height
Fixes #14553.
This commit is contained in:
@@ -329,7 +329,6 @@
|
||||
|
||||
var el = $element[0]
|
||||
var isBody = el.tagName == 'BODY'
|
||||
var isSvg = window.SVGElement && el instanceof window.SVGElement
|
||||
|
||||
var elRect = el.getBoundingClientRect()
|
||||
if (elRect.width == null) {
|
||||
@@ -338,10 +337,7 @@
|
||||
}
|
||||
var elOffset = isBody ? { top: 0, left: 0 } : $element.offset()
|
||||
var scroll = { scroll: isBody ? document.documentElement.scrollTop || document.body.scrollTop : $element.scrollTop() }
|
||||
var outerDims = isSvg ? {} : {
|
||||
width: isBody ? $(window).width() : $element.outerWidth(),
|
||||
height: isBody ? $(window).height() : $element.outerHeight()
|
||||
}
|
||||
var outerDims = isBody ? { width: $(window).width(), height: $(window).height() } : null
|
||||
|
||||
return $.extend({}, elRect, scroll, outerDims, elOffset)
|
||||
}
|
||||
|
Reference in New Issue
Block a user