Skip to content

Commit

Permalink
Revert "fix(popper): Fixed regression #401 (#402)" (#408)
Browse files Browse the repository at this point in the history
This reverts commit 1b3a82d.
  • Loading branch information
FezVrasta committed Aug 29, 2017
1 parent ad8ed0c commit 37056c1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion packages/popper/src/utils/getBoundaries.js
Expand Up @@ -50,7 +50,7 @@ export default function getBoundaries(

// In case of HTML, we need a different computation
if (boundariesNode.nodeName === 'HTML' && !isFixed(offsetParent)) {
const { height, width } = getWindowSizes(false);
const { height, width } = getWindowSizes();
boundaries.top += offsets.top - offsets.marginTop;
boundaries.bottom = height + offsets.top;
boundaries.left += offsets.left - offsets.marginLeft;
Expand Down
12 changes: 6 additions & 6 deletions packages/popper/src/utils/getWindowSizes.js
@@ -1,12 +1,12 @@
import isIE10 from './isIE10';

function getSize(axis, body, html, computedStyle, includeScroll) {
function getSize(axis, body, html, computedStyle) {
return Math.max(
body[`offset${axis}`],
includeScroll ? body[`scroll${axis}`] : 0,
body[`scroll${axis}`],
html[`client${axis}`],
html[`offset${axis}`],
includeScroll ? html[`scroll${axis}`] : 0,
html[`scroll${axis}`],
isIE10()
? html[`offset${axis}`] +
computedStyle[`margin${axis === 'Height' ? 'Top' : 'Left'}`] +
Expand All @@ -15,13 +15,13 @@ function getSize(axis, body, html, computedStyle, includeScroll) {
);
}

export default function getWindowSizes(includeScroll = true) {
export default function getWindowSizes() {
const body = window.document.body;
const html = window.document.documentElement;
const computedStyle = isIE10() && window.getComputedStyle(html);

return {
height: getSize('Height', body, html, computedStyle, includeScroll),
width: getSize('Width', body, html, computedStyle, includeScroll),
height: getSize('Height', body, html, computedStyle),
width: getSize('Width', body, html, computedStyle),
};
}

0 comments on commit 37056c1

Please sign in to comment.