Removed polyfills

This commit is contained in:
Rainer Simon 2021-07-03 17:55:31 +02:00
parent b3b2216a00
commit ed436ec8ec
1 changed files with 0 additions and 24 deletions

View File

@ -1,29 +1,5 @@
import I18n from '../i18n';
/**
* Adds DOM polyfills that babel polyfill doesn't include
*/
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;
};
}
}
/**
* Helper to init the i18n class with a pre-defined or auto-detected locale.
*/