Sha256: 3ff4acf0f76b53aa2af6164ead57f7b6c74491446fdfcf9770c74a2ab31303bc
Contents?: true
Size: 835 Bytes
Versions: 321
Compression:
Stored size: 835 Bytes
Contents
// https://plainjs.com/javascript/traversing/get-closest-element-by-selector-39/ // matches polyfill this.Element && function(ElementPrototype) { ElementPrototype.matches = ElementPrototype.matches || ElementPrototype.matchesSelector || ElementPrototype.webkitMatchesSelector || ElementPrototype.msMatchesSelector || function(selector) { var node = this, nodes = (node.parentNode || node.document).querySelectorAll(selector), i = -1; while (nodes[++i] && nodes[i] != node); return !!nodes[i]; } }(Element.prototype); // closest polyfill this.Element && function(ElementPrototype) { ElementPrototype.closest = ElementPrototype.closest || function(selector) { var el = this; while (el.matches && !el.matches(selector)) el = el.parentNode; return el.matches ? el : null; } }(Element.prototype);
Version data entries
321 entries across 321 versions & 1 rubygems