Mission Control Dashboard - Initial implementation
This commit is contained in:
21
node_modules/motion-dom/dist/es/gestures/utils/is-node-or-child.mjs
generated
vendored
Normal file
21
node_modules/motion-dom/dist/es/gestures/utils/is-node-or-child.mjs
generated
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
/**
|
||||
* Recursively traverse up the tree to check whether the provided child node
|
||||
* is the parent or a descendant of it.
|
||||
*
|
||||
* @param parent - Element to find
|
||||
* @param child - Element to test against parent
|
||||
*/
|
||||
const isNodeOrChild = (parent, child) => {
|
||||
if (!child) {
|
||||
return false;
|
||||
}
|
||||
else if (parent === child) {
|
||||
return true;
|
||||
}
|
||||
else {
|
||||
return isNodeOrChild(parent, child.parentElement);
|
||||
}
|
||||
};
|
||||
|
||||
export { isNodeOrChild };
|
||||
//# sourceMappingURL=is-node-or-child.mjs.map
|
||||
Reference in New Issue
Block a user