mirror of
https://github.com/a2nt/cms-niceties.git
synced 2024-10-22 11:05:46 +02:00
IMPR: Deffer CSS loading
This commit is contained in:
parent
6e4b32b340
commit
ed59a412f4
@ -85,7 +85,6 @@ class DeferredRequirements implements TemplateGlobalProvider
|
||||
$v = !isset($config['fontawesome_version']) || !$config['fontawesome_version']
|
||||
? Config::inst()->get(FontAwesomeField::class, 'version')
|
||||
: $config['fontawesome_version'];
|
||||
|
||||
self::loadJS('//use.fontawesome.com/releases/v'.$v.'/js/all.js');
|
||||
}
|
||||
|
||||
@ -136,7 +135,7 @@ class DeferredRequirements implements TemplateGlobalProvider
|
||||
public static function loadCSS($css): void
|
||||
{
|
||||
$external = (mb_strpos($css, '//') === 0 || mb_strpos($css, 'http') === 0);
|
||||
if ($external) {
|
||||
if (self::getDeferred() && !self::webpackActive()) {
|
||||
self::$css[] = $css;
|
||||
} else {
|
||||
WebpackTemplateProvider::loadCSS($css);
|
||||
|
Loading…
Reference in New Issue
Block a user