Removed polyfills
This commit is contained in:
parent
b3b2216a00
commit
ed436ec8ec
|
@ -1,29 +1,5 @@
|
||||||
import I18n from '../i18n';
|
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.
|
* Helper to init the i18n class with a pre-defined or auto-detected locale.
|
||||||
*/
|
*/
|
||||||
|
|
Loading…
Reference in New Issue