summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/extensions
diff options
context:
space:
mode:
authorFilipa Lacerda <filipa@gitlab.com>2016-11-29 10:35:53 +0000
committerFilipa Lacerda <filipa@gitlab.com>2016-11-30 17:06:48 +0000
commitaa2d6eec9e36acdff679d3a5ef17db0780f51447 (patch)
treebc2964489195949bdc93bab2a356f8e4ae4033a7 /app/assets/javascripts/extensions
parent6789befbf6b0578718b0e461c60326cd97dc8640 (diff)
downloadgitlab-ce-aa2d6eec9e36acdff679d3a5ef17db0780f51447.tar.gz
Improvements after review24814-pipeline-tabs
Diffstat (limited to 'app/assets/javascripts/extensions')
-rw-r--r--app/assets/javascripts/extensions/element.js.es626
1 files changed, 12 insertions, 14 deletions
diff --git a/app/assets/javascripts/extensions/element.js.es6 b/app/assets/javascripts/extensions/element.js.es6
index 328cc57dca0..3f12ad9ff9f 100644
--- a/app/assets/javascripts/extensions/element.js.es6
+++ b/app/assets/javascripts/extensions/element.js.es6
@@ -6,17 +6,15 @@ Element.prototype.closest = Element.prototype.closest || function closest(select
return selectedElement.matches(selector) ? selectedElement : Element.prototype.closest(selector, selectedElement.parentElement);
};
-if (!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;
- while (--i >= 0 && matches.item(i) !== this) {}
- return i > -1;
- };
-}
+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;
+ while (--i >= 0 && matches.item(i) !== this) {}
+ return i > -1;
+ };