Skip to content
This repository has been archived by the owner on Aug 26, 2022. It is now read-only.

Commit

Permalink
Merge pull request #3283 from darkwing/1150118-cleanup
Browse files Browse the repository at this point in the history
bug 1150118 - A bit of JS cleanup
  • Loading branch information
stephaniehobson committed Jun 30, 2015
2 parents 16159f7 + 408dbca commit ff9310d
Showing 1 changed file with 20 additions and 19 deletions.
39 changes: 20 additions & 19 deletions media/js/fonts.js
Expand Up @@ -6,21 +6,21 @@
// what fonts are we loading?
var fonts = [
{
"name" : "Open Sans Light",
"class" : "ffo-opensanslight",
"varient" : [
{"weight" : "normal"},
{"weight" : "bold"},
{"style" : "italic"}
'name' : 'Open Sans Light',
'class' : 'ffo-opensanslight',
'varient' : [
{'weight' : 'normal'},
{'weight' : 'bold'},
{'style' : 'italic'}
]
},
{
"name" : "Open Sans",
"class" : "ffo-opensans",
"varient" : [
{"weight" : "normal"},
{"weight" : "bold"},
{"style" : "italic"}
'name' : 'Open Sans',
'class' : 'ffo-opensans',
'varient' : [
{'weight' : 'normal'},
{'weight' : 'bold'},
{'style' : 'italic'}
]
}
];
Expand All @@ -33,8 +33,8 @@

// load the observer plug in
$.getScript('/media/js/fontfaceobserver-min.js')
.done(ffoLoad)
.fail(ffoFinished);
.done(ffoLoad)
.fail(ffoFinished);

// starts observers for all fonts in fonts array
function ffoLoad() {
Expand Down Expand Up @@ -80,11 +80,11 @@
$.each(fontsLoaded, function(){
var isLoaded = true;
$.each(this, function(){
if(this == false) {
if(!this) {
isLoaded = false;
}
})
if(isLoaded == false) {
if(!isLoaded) {
allLoaded = false;
}
});
Expand All @@ -110,13 +110,14 @@
$.each(fontsLoaded, function(index) {
var fontAttribute = index;
var fontLoaded = true;

$.each(this, function() {
if(this == false) {
if(!this) {
fontLoaded = false;
}
})
if(fontLoaded == true) {
$('html').attr("data-"+fontAttribute, true);
if(fontLoaded) {
$('html').attr('data-' + fontAttribute, true);
}
});
}
Expand Down

0 comments on commit ff9310d

Please sign in to comment.