Skip to content

Commit

Permalink
Matches Polyfill (#1100)
Browse files Browse the repository at this point in the history
  • Loading branch information
DiscoTim authored and FrostTheFox committed Sep 14, 2016
1 parent eaa3aa3 commit e6de045
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions static/js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,20 @@
'use strict'

// Methods/polyfills.
if (!Element.prototype.matches) {
Element.prototype.matches =
Element.prototype.matchesSelector ||
Element.prototype.mozMatchesSelector ||
Element.prototype.msMatchesSelector ||
Element.prototype.oMatchesSelector ||
Element.prototype.webkitMatchesSelector ||
function (s) {
var matches = (this.document || this.ownerDocument).querySelectorAll(s)
var i = matches.length
while (--i >= 0 && matches.item(i) !== this) {}
return i > -1
}
}

// addEventsListener
var addEventsListener = function (o, t, e) {
Expand Down

0 comments on commit e6de045

Please sign in to comment.