open-consul/ui-v2/app/utils/dom/closest.js

11 lines
241 B
JavaScript
Raw Normal View History

export default function(sel, el) {
// basic DOM closest utility to cope with no support
// TODO: instead of degrading gracefully
// add a while polyfill for closest
try {
return el.closest(sel);
} catch (e) {
return;
}
}