From e6de0458137f97dab2492dc501fa7287897c844f Mon Sep 17 00:00:00 2001 From: Johnny Disco Date: Wed, 14 Sep 2016 16:02:24 -0400 Subject: [PATCH] Matches Polyfill (#1100) --- static/js/app.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/static/js/app.js b/static/js/app.js index b6a8470c7a..2d1fb7508b 100644 --- a/static/js/app.js +++ b/static/js/app.js @@ -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) {