@grafana/ui
Version:
Grafana Components Library
16 lines (15 loc) • 448 B
JavaScript
if (typeof window !== "undefined" && "Element" in window && !Element.prototype.closest) {
Element.prototype.closest = function(s) {
const matches = (this.document || this.ownerDocument).querySelectorAll(s);
let el = this;
let i;
do {
i = matches.length;
while (--i >= 0 && matches.item(i) !== el) {
}
el = el.parentElement;
} while (i < 0 && el);
return el;
};
}
//# sourceMappingURL=dom.mjs.map