Skip to content
Snippets Groups Projects
Commit ec86c86f authored by Cam Saül's avatar Cam Saül
Browse files

Load Google Maps & Google Fonts asynchronously :flushed: #1922

parent 7aabca15
No related branches found
No related tags found
No related merge requests found
......@@ -19,16 +19,23 @@
<main class="Main flex flex-column flex-full" ng-view></main>
</body>
<script src="https://ajax.googleapis.com/ajax/libs/webfont/1.4.7/webfont.js"></script>
<script>
WebFont.load({
google: { families: ['Lato:n3,n4,n7'] }
});
<script type="text/javascript">
(function () {
function loadScript(src, onload) {
var script = document.createElement('script');
script.type = "text/javascript";
script.async = true;
script.src = src;
if (onload) script.onload = onload;
document.body.appendChild(script);
}
loadScript('https://ajax.googleapis.com/ajax/libs/webfont/1.4.7/webfont.js', function () {
WebFont.load({ google: { families: ["Lato:n3,n4,n7"] } });
});
loadScript('https://maps.googleapis.com/maps/api/js');
})();
</script>
<script src="https://maps.googleapis.com/maps/api/js" type="text/javascript"></script>
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
......
......@@ -142,6 +142,7 @@
:script-src ["'unsafe-inline'"
"'unsafe-eval'"
"'self'"
"https://maps.google.com"
"https://www.google-analytics.com" ; Safari requires the protocol
"https://*.googleapis.com"
"*.gstatic.com"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment