polyfills.js 888 B

1234567891011121314151617181920212223242526272829
  1. import 'core-js/es6/string';
  2. import 'core-js/es6/array';
  3. import 'core-js/es6/map';
  4. import 'core-js/es6/set';
  5. import 'core-js/es6/object';
  6. import 'core-js/es6/promise';
  7. import 'core-js/es7/object';
  8. import 'core-js/es7/array';
  9. import 'raf/polyfill';
  10. if (typeof window !== 'undefined') {
  11. // IE11 matches polyfill
  12. if (!Element.prototype.matches) {
  13. Element.prototype.matches =
  14. Element.prototype.msMatchesSelector || Element.prototype.webkitMatchesSelector;
  15. }
  16. // IE11 Element.closest polyfill
  17. if (!Element.prototype.closest) {
  18. Element.prototype.closest = function(s) {
  19. var el = this;
  20. do {
  21. if (el.matches(s)) return el;
  22. el = el.parentElement || el.parentNode;
  23. } while (el !== null && el.nodeType === 1);
  24. return null;
  25. };
  26. }
  27. }