summaryrefslogtreecommitdiff
path: root/assets/js/polyfills
diff options
context:
space:
mode:
Diffstat (limited to 'assets/js/polyfills')
-rw-r--r--assets/js/polyfills/matches.js14
1 files changed, 14 insertions, 0 deletions
diff --git a/assets/js/polyfills/matches.js b/assets/js/polyfills/matches.js
new file mode 100644
index 00000000..a6f813bf
--- /dev/null
+++ b/assets/js/polyfills/matches.js
@@ -0,0 +1,14 @@
+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),
+ i = matches.length;
+ while (--i >= 0 && matches.item(i) !== this) {}
+ return i > -1;
+ };
+}