- Updated all component headers and documentation
- Changed navbar and footer branding
- Updated homepage hero badge
- Modified page title in index.html
- Simplified footer text to 'Built with ❤️'
- Consistent V2 capitalization across all references
26 lines
747 B
JavaScript
26 lines
747 B
JavaScript
'use strict';
|
|
|
|
var isElement = require('./is-element.cjs');
|
|
|
|
function isScrollParent(el) {
|
|
const win = el.ownerDocument.defaultView || window;
|
|
const { overflow, overflowX, overflowY } = win.getComputedStyle(el);
|
|
return /auto|scroll|overlay|hidden/.test(overflow + overflowY + overflowX);
|
|
}
|
|
function getParent(el) {
|
|
if (el.localName === "html")
|
|
return el;
|
|
return el.assignedSlot || el.parentElement || el.ownerDocument.documentElement;
|
|
}
|
|
function getScrollParent(el) {
|
|
if (["html", "body", "#document"].includes(el.localName)) {
|
|
return el.ownerDocument.body;
|
|
}
|
|
if (isElement.isHTMLElement(el) && isScrollParent(el)) {
|
|
return el;
|
|
}
|
|
return getScrollParent(getParent(el));
|
|
}
|
|
|
|
exports.getScrollParent = getScrollParent;
|