terra-overlay
Version:
The Overlay component is a component that creates an semi-transparent overlay screen that blocks interactions with the elements underneath the display. There are two types of overlays: fullscreen and relative to its container.
20 lines (19 loc) • 602 B
JavaScript
// Source: https://github.com/Financial-Times/polyfill-service/pull/183/files
// Needed for IE11 and IE10
if (!Node.prototype.contains) {
Node.prototype.contains = function contains(node) {
/* eslint-disable-next-line prefer-rest-params */
if (!(0 in arguments)) {
throw new TypeError('1 argument is required');
}
/* eslint-disable no-cond-assign */
do {
if (this === node) {
return true;
}
/* eslint-disable-next-line no-param-reassign */
} while (node = node && node.parentNode);
return false;
/* eslint-enable no-cond-assign */
};
}