From 252cf943f594a50e9240dde4da017e726d13ea59 Mon Sep 17 00:00:00 2001 From: Rainer Simon Date: Fri, 8 May 2020 21:00:15 +0200 Subject: [PATCH] Cleanup --- src/utils/MSEdgePolyfills.js | 20 -------------------- src/utils/index.js | 21 +++++++++++++++++++++ 2 files changed, 21 insertions(+), 20 deletions(-) delete mode 100644 src/utils/MSEdgePolyfills.js diff --git a/src/utils/MSEdgePolyfills.js b/src/utils/MSEdgePolyfills.js deleted file mode 100644 index 4d7d508..0000000 --- a/src/utils/MSEdgePolyfills.js +++ /dev/null @@ -1,20 +0,0 @@ -export const addPolyfills = () => { - - if (!Element.prototype.matches) { - Element.prototype.matches = Element.prototype.msMatchesSelector || - Element.prototype.webkitMatchesSelector; - } - - if (!Element.prototype.closest) { - Element.prototype.closest = function(s) { - let el = this; - - do { - if (Element.prototype.matches.call(el, s)) return el; - el = el.parentElement || el.parentNode; - } while (el !== null && el.nodeType === 1); - return null; - }; - } - -} diff --git a/src/utils/index.js b/src/utils/index.js index c4b4d6a..4b56e38 100644 --- a/src/utils/index.js +++ b/src/utils/index.js @@ -46,4 +46,25 @@ const deflateNodeList = parents => { if (childrenWithChildren.length > 0) deflateNodeList(childrenWithChildren); +} + +export const addPolyfills = () => { + + if (!Element.prototype.matches) { + Element.prototype.matches = Element.prototype.msMatchesSelector || + Element.prototype.webkitMatchesSelector; + } + + if (!Element.prototype.closest) { + Element.prototype.closest = function(s) { + let el = this; + + do { + if (Element.prototype.matches.call(el, s)) return el; + el = el.parentElement || el.parentNode; + } while (el !== null && el.nodeType === 1); + return null; + }; + } + } \ No newline at end of file