Created
August 23, 2013 16:15
-
-
Save davidcornu/6321150 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function(){ | |
var fontsLoaded = false; | |
var listeners = []; | |
function fontsDidLoad(){ | |
for (var i = 0; i < listeners.length; i += 1) { setTimeout(listeners[i], 0); } | |
fontsLoaded = true; | |
} | |
window.onFontsLoaded = function(callback){ | |
if (fontsLoaded) return setTimeout(callback, 0); | |
listeners.push(callback); | |
}; | |
Typekit.load({ active: fontsDidLoad }); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment