You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
18 lines
463 B
18 lines
463 B
"use strict";
|
|
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports["default"] = closest;
|
|
function closest(el, selector) {
|
|
var matchesSelector = el.matches || el.webkitMatchesSelector || el.mozMatchesSelector || el.msMatchesSelector;
|
|
var p = el;
|
|
while (p) {
|
|
if (matchesSelector.call(p, selector)) {
|
|
return p;
|
|
}
|
|
p = p.parentElement;
|
|
}
|
|
return null;
|
|
}
|
|
module.exports = exports["default"]; |