summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/extensions/element.js
diff options
context:
space:
mode:
Diffstat (limited to 'app/assets/javascripts/extensions/element.js')
-rw-r--r--app/assets/javascripts/extensions/element.js20
1 files changed, 0 insertions, 20 deletions
diff --git a/app/assets/javascripts/extensions/element.js b/app/assets/javascripts/extensions/element.js
deleted file mode 100644
index 90ab79305a7..00000000000
--- a/app/assets/javascripts/extensions/element.js
+++ /dev/null
@@ -1,20 +0,0 @@
-/* global Element */
-/* eslint-disable consistent-return, max-len, no-empty, func-names */
-
-Element.prototype.closest = Element.prototype.closest || function closest(selector, selectedElement = this) {
- if (!selectedElement) return;
- return selectedElement.matches(selector) ? selectedElement : Element.prototype.closest(selector, selectedElement.parentElement);
-};
-
-Element.prototype.matches = Element.prototype.matches ||
- Element.prototype.matchesSelector ||
- Element.prototype.mozMatchesSelector ||
- Element.prototype.msMatchesSelector ||
- Element.prototype.oMatchesSelector ||
- Element.prototype.webkitMatchesSelector ||
- function (s) {
- const matches = (this.document || this.ownerDocument).querySelectorAll(s);
- let i = matches.length - 1;
- while (i >= 0 && matches.item(i) !== this) { i -= 1; }
- return i > -1;
- };