forked from jonathantneal/svg4everybody
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsvg4everybody.min.js
2 lines (2 loc) · 1.1 KB
/
svg4everybody.min.js
1
2
/*! svg4everybody v1.0.0 | github.com/jonathantneal/svg4everybody */
(function(a,b,g,c,d){function h(i,k){if(k){var m=k.getAttribute("viewBox"),l=k.getAttribute("preserveAspectRatio"),j=a.createDocumentFragment(),n=k.cloneNode(true);if(m){i.setAttribute("viewBox",m)}if(l){i.setAttribute("preserveAspectRatio",l)}while(n.childNodes.length){j.appendChild(n.childNodes[0])}i.appendChild(j)}}function f(){var k=this,i=a.createElement("x"),j=k.s;i.innerHTML=k.responseText;k.onload=function(){j.splice(0).map(function(l){h(l[0],i.querySelector("#"+l[1].replace(/(\W)/g,"\\$1")))})};k.onload()}function e(){var i;while((i=b[0])){var k=i.parentNode,l=i.getAttribute("xlink:href").split("#"),m=l[0],j=l[1];k.removeChild(i);if(m.length){var n=c[m]=c[m]||new XMLHttpRequest();if(!n.s){n.s=[];n.open("GET",m);n.onload=f;n.send()}n.s.push([k,j]);if(n.readyState===4){n.onload()}}else{h(k,a.getElementById(j))}}g(e)}if(d){e()}})(document,document.getElementsByTagName("use"),window.requestAnimationFrame||window.setTimeout,{},/Trident\/[567]\b/.test(navigator.userAgent)||(navigator.userAgent.match(/AppleWebKit\/(\d+)/)||[])[1]<537);