Skip to content

Commit b088c3b

Browse files
committed
Work-around for Chrome lazy (and slowly) loading data-uri web fonts
Fixes freeCodeCamp#455.
1 parent de35948 commit b088c3b

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

assets/javascripts/app/app.coffee

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,11 +181,13 @@
181181
showLoading: ->
182182
document.body.classList.remove '_noscript'
183183
document.body.classList.add '_loading'
184+
document.body.insertAdjacentHTML 'beforeend', '<div id="fontLoader" aria-hidden="true" style="position: absolute; top: 0; height: 0; overflow: hidden; visibility: hidden;"><b>Preload</b> <em>all <b>fonts</b></em></div>' # Chrome
184185
return
185186

186187
hideLoading: ->
187188
document.body.classList.remove '_booting'
188189
document.body.classList.remove '_loading'
190+
$.remove document.getElementById('fontLoader')
189191
return
190192

191193
indexHost: ->

0 commit comments

Comments
 (0)