forgeplus-react/node_modules/dom-lib/es/query/isOverflowing.js

20 lines
554 B
JavaScript

import getWindow from './getWindow';
import ownerDocument from './ownerDocument';
function bodyIsOverflowing(node) {
var doc = ownerDocument(node);
var win = getWindow(doc);
var fullWidth = win.innerWidth;
if (doc.body) {
return doc.body.clientWidth < fullWidth;
}
return false;
}
export default (function (container) {
var win = getWindow(container);
var isBody = container && container.tagName.toLowerCase() === 'body';
return win || isBody ? bodyIsOverflowing(container) : container.scrollHeight > container.clientHeight;
});