diff --git a/web/app/app.js b/web/app/app.js index 5d562137..8b48fb05 100644 --- a/web/app/app.js +++ b/web/app/app.js @@ -1,4 +1,8 @@ +import 'babel-polyfill'; // TODO: remove it import 'mimic'; // TODO: it's for dev only + +import './polyfills'; // TODO: check it + import fetcher from './fetcher'; import render from './render'; @@ -7,5 +11,5 @@ require('./main.scss'); // TODO: add preloader // TODO: all of these settings must be optional params fetcher - .get('/find?site=remark&url=https://radio-t.com/p/2017/12/16/podcast-576/&sort=time&format=tree') + .get('/find?url=https://radio-t.com/p/2017/12/16/podcast-576/&sort=time&format=tree') .then(render); diff --git a/web/app/polyfills.js b/web/app/polyfills.js new file mode 100644 index 00000000..3967d187 --- /dev/null +++ b/web/app/polyfills.js @@ -0,0 +1,14 @@ +if (!Element.prototype.matches) + Element.prototype.matches = Element.prototype.msMatchesSelector || + Element.prototype.webkitMatchesSelector; + +if (!Element.prototype.closest) + Element.prototype.closest = function(s) { + var el = this; + if (!document.documentElement.contains(el)) return null; + do { + if (el.matches(s)) return el; + el = el.parentElement || el.parentNode; + } while (el !== null); + return null; + };