summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFatih Acet <acetfatih@gmail.com>2016-11-04 19:51:27 +0000
committerFatih Acet <acetfatih@gmail.com>2016-11-04 19:51:27 +0000
commit1dfe10d3dac53a58d7e4a4e115cec9ee58f9cd2b (patch)
tree9c260cd9e891d762a38af246aa70693adff9689f
parent6f78b2642b1ed8f156e7c95436a20a312e3e6ae8 (diff)
parent7c84037e6caa5044ab391ef9d9e6a7528a856abe (diff)
downloadgitlab-ce-1dfe10d3dac53a58d7e4a4e115cec9ee58f9cd2b.tar.gz
Merge branch 'add-matches-and-closest-element-extensions' into 'master'
Added Element extension with .matches and .closest ## What does this MR do? This adds `.matches` and `.closest` polyfills that will help when removing/not using jQuery. I added these in another MR which was then refactored to not require these methods, but I thought we might as well not lose the code. ## Are there points in the code the reviewer needs to double check? ## Why was this MR needed? Help when removing/not using jQuery. ## Screenshots (if relevant) ## Does this MR meet the acceptance criteria? - [ ] [CHANGELOG](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CHANGELOG) entry added - [ ] [Documentation created/updated](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/doc/development/doc_styleguide.md) - [ ] API support added - Tests - [ ] Added for this feature/bug - [ ] All builds are passing - [ ] Conform by the [merge request performance guides](http://docs.gitlab.com/ce/development/merge_request_performance_guidelines.html) - [ ] Conform by the [style guides](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CONTRIBUTING.md#style-guides) - [ ] Branch has no merge conflicts with `master` (if it does - rebase it please) - [ ] [Squashed related commits together](https://git-scm.com/book/en/Git-Tools-Rewriting-History#Squashing-Commits) ## What are the relevant issue numbers? See merge request !6946
-rw-r--r--app/assets/javascripts/extensions/element.js.es66
1 files changed, 4 insertions, 2 deletions
diff --git a/app/assets/javascripts/extensions/element.js.es6 b/app/assets/javascripts/extensions/element.js.es6
index c74fc9ad074..afb2f0d6956 100644
--- a/app/assets/javascripts/extensions/element.js.es6
+++ b/app/assets/javascripts/extensions/element.js.es6
@@ -1,5 +1,7 @@
-/* eslint-disable */
-Element.prototype.matches = Element.prototype.matches || Element.prototype.msMatches;
+/* global Element */
+/* eslint-disable consistent-return, max-len */
+
+Element.prototype.matches = Element.prototype.matches || Element.prototype.msMatchesSelector;
Element.prototype.closest = function closest(selector, selectedElement = this) {
if (!selectedElement) return;