Added Element extension with .matches and .closest

This commit is contained in:
Luke "Jared" Bennett 2016-10-17 17:14:46 +00:00
parent 75d15be9b2
commit 7c84037e6c
No known key found for this signature in database
GPG key ID: 402ED51FB5D306C2

View file

@ -1,5 +1,7 @@
/* eslint-disable */
Element.prototype.matches = Element.prototype.matches || Element.prototype.msMatches;
/* global Element */
/* eslint-disable consistent-return, max-len */
Element.prototype.matches = Element.prototype.matches || Element.prototype.msMatchesSelector;
Element.prototype.closest = function closest(selector, selectedElement = this) {
if (!selectedElement) return;