Commit 1dfe10d3 authored by Fatih Acet's avatar Fatih Acet

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
parents 6f78b264 7c84037e
/* 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;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment