1
0
Эх сурвалжийг харах

Work-around for Chrome lazy (and slowly) loading data-uri web fonts

Fixes #455.
Thibaut Courouble 9 жил өмнө
parent
commit
b088c3b2ed

+ 2 - 0
assets/javascripts/app/app.coffee

@@ -181,11 +181,13 @@
   showLoading: ->
     document.body.classList.remove '_noscript'
     document.body.classList.add '_loading'
+    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
     return
 
   hideLoading: ->
     document.body.classList.remove '_booting'
     document.body.classList.remove '_loading'
+    $.remove document.getElementById('fontLoader')
     return
 
   indexHost: ->