diff options
author | Sam Potts <sam@potts.es> | 2019-06-01 18:45:07 +1000 |
---|---|---|
committer | Sam Potts <sam@potts.es> | 2019-06-01 18:45:07 +1000 |
commit | c9055f391b3782d96d16fb6efa4337dc90120635 (patch) | |
tree | 6cd7d1fc8627bbe62f4f714a99fe3cd2ec49db09 /src/js/utils/elements.js | |
parent | 5ddd9e02def654bb677c988403dbefbc4a32787c (diff) | |
download | plyr-c9055f391b3782d96d16fb6efa4337dc90120635.tar.lz plyr-c9055f391b3782d96d16fb6efa4337dc90120635.tar.xz plyr-c9055f391b3782d96d16fb6efa4337dc90120635.zip |
Linting changes
Diffstat (limited to 'src/js/utils/elements.js')
-rw-r--r-- | src/js/utils/elements.js | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/src/js/utils/elements.js b/src/js/utils/elements.js index 9c1ddebc..98b44f13 100644 --- a/src/js/utils/elements.js +++ b/src/js/utils/elements.js @@ -17,7 +17,6 @@ export function wrap(elements, wrapper) { .reverse() .forEach((element, index) => { const child = index > 0 ? wrapper.cloneNode(true) : wrapper; - // Cache the current parent and sibling. const parent = element.parentNode; const sibling = element.nextSibling; @@ -145,12 +144,10 @@ export function getAttributesFromSelector(sel, existingAttributes) { const selector = s.trim(); const className = selector.replace('.', ''); const stripped = selector.replace(/[[\]]/g, ''); - // Get the parts and value const parts = stripped.split('='); const [key] = parts; const value = parts.length > 1 ? parts[1].replace(/["']/g, '') : ''; - // Get the first character const start = selector.charAt(0); @@ -234,14 +231,14 @@ export function matches(element, selector) { return Array.from(document.querySelectorAll(selector)).includes(this); } - const matches = + const method = prototype.matches || prototype.webkitMatchesSelector || prototype.mozMatchesSelector || prototype.msMatchesSelector || match; - return matches.call(element, selector); + return method.call(element, selector); } // Find all elements |