diff options
author | Fatih Acet <acetfatih@gmail.com> | 2016-11-23 17:48:43 +0000 |
---|---|---|
committer | Fatih Acet <acetfatih@gmail.com> | 2016-11-23 17:48:43 +0000 |
commit | 981926834a446c2f6f581006e1bb6ca4b5ee9e68 (patch) | |
tree | d940348381f1603dc952b121d6350e6078a57d2f /app | |
parent | 00162d24d909a127656eae9393b01b36c23d4254 (diff) | |
parent | 6892293e730b98d324b5d92663349e9ee42a70a9 (diff) | |
download | gitlab-ce-981926834a446c2f6f581006e1bb6ca4b5ee9e68.tar.gz |
Merge branch 'use-default-closest-if-available' into 'master'
Use default `closest` if available!
## What does this MR do?
We should use the default `Element.prototype.closest` if its available.
## Are there points in the code the reviewer needs to double check?
## Why was this MR needed?
## Screenshots (if relevant)
## Does this MR meet the acceptance criteria?
- [ ] [Changelog entry](https://docs.gitlab.com/ce/development/changelog.html) 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
- [x] All builds are passing
- [x] Conform by the [merge request performance guides](http://docs.gitlab.com/ce/development/merge_request_performance_guidelines.html)
- [x] Conform by the [style guides](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CONTRIBUTING.md#style-guides)
- [x] Branch has no merge conflicts with `master` (if it does - rebase it please)
- [x] [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 !7706
Diffstat (limited to 'app')
-rw-r--r-- | app/assets/javascripts/extensions/element.js.es6 | 2 |
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); }; |