You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
trezor-wallet/src/utils/windowUtils.js

17 lines
525 B

/* @flow */
export const getViewportHeight = (): number => (
// $FlowIssue
window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight // $FlowIssue
);
export const getScrollY = (): number => {
if (window.pageYOffset !== undefined) {
return window.pageYOffset;
} if (window.scrollTop !== undefined) {
return window.scrollTop;
}
// $FlowIssue
return (document.documentElement || document.body.parentNode || document.body).scrollTop; // $FlowIssue
};