first commit
This commit is contained in:
20
frontend/node_modules/rc-util/es/Dom/contains.js
generated
vendored
Normal file
20
frontend/node_modules/rc-util/es/Dom/contains.js
generated
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
export default function contains(root, n) {
|
||||
if (!root) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Use native if support
|
||||
if (root.contains) {
|
||||
return root.contains(n);
|
||||
}
|
||||
|
||||
// `document.contains` not support with IE11
|
||||
var node = n;
|
||||
while (node) {
|
||||
if (node === root) {
|
||||
return true;
|
||||
}
|
||||
node = node.parentNode;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
Reference in New Issue
Block a user