load lato font after dom ready
This commit is contained in:
@@ -4,6 +4,32 @@ $(document).ready(function() {
|
|||||||
challengeName :
|
challengeName :
|
||||||
'Untitled';
|
'Untitled';
|
||||||
|
|
||||||
|
// pre-cache fonts
|
||||||
|
var lightDef = $.ajax({
|
||||||
|
url: '/fonts/Lato-Light.ttf',
|
||||||
|
beforeSend: function(xhr) {
|
||||||
|
xhr.overrideMimeType('application/octet-stream');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
var regularDef = $.ajax({
|
||||||
|
url: '/fonts/Lato-Regular.ttf',
|
||||||
|
beforeSend: function(xhr) {
|
||||||
|
xhr.overrideMimeType('application/octet-stream');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
// now add link to css
|
||||||
|
$.when(lightDef, regularDef).then(function() {
|
||||||
|
$('<link />')
|
||||||
|
.attr({
|
||||||
|
type: 'text/css',
|
||||||
|
rel: 'stylesheet',
|
||||||
|
href: '/css/lato.css'
|
||||||
|
})
|
||||||
|
.appendTo('head');
|
||||||
|
});
|
||||||
|
|
||||||
if (challengeName) {
|
if (challengeName) {
|
||||||
ga('send', 'event', 'Challenge', 'load', challengeName);
|
ga('send', 'event', 'Challenge', 'load', challengeName);
|
||||||
}
|
}
|
||||||
|
@@ -1,6 +1,5 @@
|
|||||||
script(src="//ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js")
|
script(src="//ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js")
|
||||||
script(src="//cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.4/js/bootstrap.min.js")
|
script(src="//cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.4/js/bootstrap.min.js")
|
||||||
link(rel='stylesheet' type='text/css' href='/css/lato.css')
|
|
||||||
link(rel='stylesheet', href='/bower_components/font-awesome/css/font-awesome.min.css')
|
link(rel='stylesheet', href='/bower_components/font-awesome/css/font-awesome.min.css')
|
||||||
link(rel='stylesheet', href=rev('/css', 'main.css'))
|
link(rel='stylesheet', href=rev('/css', 'main.css'))
|
||||||
link(rel='stylesheet', href='/css/Vimeo.css')
|
link(rel='stylesheet', href='/css/Vimeo.css')
|
||||||
|
@@ -1,4 +1,3 @@
|
|||||||
link(rel="stylesheet" type="text/css" href="/css/lato.css")
|
|
||||||
link(rel="stylesheet" type="text/css" href="/bower_components/cal-heatmap/cal-heatmap.css")
|
link(rel="stylesheet" type="text/css" href="/bower_components/cal-heatmap/cal-heatmap.css")
|
||||||
link(rel='stylesheet', href='/bower_components/font-awesome/css/font-awesome.min.css')
|
link(rel='stylesheet', href='/bower_components/font-awesome/css/font-awesome.min.css')
|
||||||
link(rel='stylesheet', href='/bower_components/lightbox2/dist/css/lightbox.css')
|
link(rel='stylesheet', href='/bower_components/lightbox2/dist/css/lightbox.css')
|
||||||
|
Reference in New Issue
Block a user