@react-md/utils
Version:
General utils for react-md.
15 lines • 514 B
JavaScript
/**
* This is a simple wrapper to get the view width or view height.
*
* @param direction - Either the "height" or "width" string to get that
* dimension
* @returns the view width or view height.
*/
export function getViewportSize(direction) {
var de = document.documentElement || { clientHeight: 0, clientWidth: 0 };
if (direction === "width") {
return window.innerWidth || de.clientWidth;
}
return window.innerHeight || de.clientHeight;
}
//# sourceMappingURL=getViewportSize.js.map