Skip to content

Commit fad9a9f

Browse files
authored
refactor: removed polyfill out of codebase (pattern-lab#1398)
* refactor: integrated polyfill as a dependency * refactor: .matches polyfill is even already included in .closest polyfill * refactor: reverted yarn.lock as there weren't any relevant changes out of this pull requests code changes
1 parent fb169cc commit fad9a9f

File tree

1 file changed

+0
-18
lines changed

1 file changed

+0
-18
lines changed

packages/uikit-workshop/src/scripts/components/pl-nav/get-parents.js

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,4 @@
11
export const getParents = (elem, selector) => {
2-
// Element.matches() polyfill
3-
if (!Element.prototype.matches) {
4-
Element.prototype.matches =
5-
Element.prototype.matchesSelector ||
6-
Element.prototype.mozMatchesSelector ||
7-
Element.prototype.msMatchesSelector ||
8-
Element.prototype.oMatchesSelector ||
9-
Element.prototype.webkitMatchesSelector ||
10-
function (s) {
11-
const matches = (this.document || this.ownerDocument).querySelectorAll(
12-
s
13-
),
14-
i = matches.length;
15-
while (--i >= 0 && matches.item(i) !== this) {}
16-
return i > -1;
17-
};
18-
}
19-
202
// Set up a parent array
213
const parents = [];
224

0 commit comments

Comments
 (0)