1 | "use strict";
|
2 |
|
3 | var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
4 |
|
5 | exports.__esModule = true;
|
6 | exports["default"] = isOverflowing;
|
7 |
|
8 | var _isWindow = _interopRequireDefault(require("dom-helpers/isWindow"));
|
9 |
|
10 | var _ownerDocument = _interopRequireDefault(require("dom-helpers/ownerDocument"));
|
11 |
|
12 | function isBody(node) {
|
13 | return node && node.tagName.toLowerCase() === 'body';
|
14 | }
|
15 |
|
16 | function bodyIsOverflowing(node) {
|
17 | var doc = (0, _isWindow["default"])(node) ? (0, _ownerDocument["default"])() : (0, _ownerDocument["default"])(node);
|
18 | var win = (0, _isWindow["default"])(node) || doc.defaultView;
|
19 | return doc.body.clientWidth < win.innerWidth;
|
20 | }
|
21 |
|
22 | function isOverflowing(container) {
|
23 | var win = (0, _isWindow["default"])(container);
|
24 | return win || isBody(container) ? bodyIsOverflowing(container) : container.scrollHeight > container.clientHeight;
|
25 | }
|
26 |
|
27 | module.exports = exports.default; |
\ | No newline at end of file |