summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke "Jared" Bennett <lbennett@gitlab.com>2016-11-23 14:56:28 +0000
committerLuke "Jared" Bennett <lbennett@gitlab.com>2016-11-23 14:56:28 +0000
commit6892293e730b98d324b5d92663349e9ee42a70a9 (patch)
treed4da9714d9ad8c9d338946aa193f23fd5cde84df
parent3e0c6142d120538476019c877cf265c9a7f08c74 (diff)
downloadgitlab-ce-use-default-closest-if-available.tar.gz
Use default `closest` if available!use-default-closest-if-available
-rw-r--r--app/assets/javascripts/extensions/element.js.es62
1 files changed, 1 insertions, 1 deletions
diff --git a/app/assets/javascripts/extensions/element.js.es6 b/app/assets/javascripts/extensions/element.js.es6
index afb2f0d6956..6d9b0c4bc3e 100644
--- a/app/assets/javascripts/extensions/element.js.es6
+++ b/app/assets/javascripts/extensions/element.js.es6
@@ -3,7 +3,7 @@
Element.prototype.matches = Element.prototype.matches || Element.prototype.msMatchesSelector;
-Element.prototype.closest = function closest(selector, selectedElement = this) {
+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);
};