mirror of
https://github.com/go-gitea/gitea.git
synced 2024-11-30 05:07:06 +08:00
24859fe5b6
Firefox users will experience a flash of unstyled content on loading various pages, this patch will fix this issue using Filament Groups loadCSS library to asynchronously load the CSS responsible for the FOUC. Will fix #1698. Signed-off-by: Sondre Nilsen <nilsen.sondre@gmail.com>
2 lines
809 B
JavaScript
2 lines
809 B
JavaScript
/*! loadCSS. [c]2017 Filament Group, Inc. MIT License */
|
|
!function(a){"use strict";var b=function(b,c,d){function e(a){return h.body?a():void setTimeout(function(){e(a)})}function f(){i.addEventListener&&i.removeEventListener("load",f),i.media=d||"all"}var g,h=a.document,i=h.createElement("link");if(c)g=c;else{var j=(h.body||h.getElementsByTagName("head")[0]).childNodes;g=j[j.length-1]}var k=h.styleSheets;i.rel="stylesheet",i.href=b,i.media="only x",e(function(){g.parentNode.insertBefore(i,c?g:g.nextSibling)});var l=function(a){for(var b=i.href,c=k.length;c--;)if(k[c].href===b)return a();setTimeout(function(){l(a)})};return i.addEventListener&&i.addEventListener("load",f),i.onloadcssdefined=l,l(f),i};"undefined"!=typeof exports?exports.loadCSS=b:a.loadCSS=b}("undefined"!=typeof global?global:this); |