IMPR: Requirements priority improvement

This commit is contained in:
Tony Air 2021-12-23 00:02:26 +02:00
parent 33a10bdc1e
commit 395266963c

View File

@ -81,20 +81,6 @@ class DeferredRequirements implements TemplateGlobalProvider
} }
} }
// App libs
if (!$config['nofontawesome']) {
$v = !isset($config['fontawesome_version']) || !$config['fontawesome_version']
? Config::inst()->get(FontAwesomeField::class, 'version')
: $config['fontawesome_version'];
if ($config['fontawesome_svg']) {
Requirements::customScript('FontAwesomeConfig={searchPseudoElements:true}');
self::loadJS('//use.fontawesome.com/releases/v'.$v.'/js/all.js');
} else {
self::loadCSS('//use.fontawesome.com/releases/v'.$v.'/css/all.css');
}
}
self::loadCSS($mainTheme.'.css'); self::loadCSS($mainTheme.'.css');
// hot reloading // hot reloading
@ -136,6 +122,20 @@ class DeferredRequirements implements TemplateGlobalProvider
self::loadJS($projectName.'_'.$curr_class . '.js'); self::loadJS($projectName.'_'.$curr_class . '.js');
} }
// App libs
if (!$config['nofontawesome']) {
$v = !isset($config['fontawesome_version']) || !$config['fontawesome_version']
? Config::inst()->get(FontAwesomeField::class, 'version')
: $config['fontawesome_version'];
if ($config['fontawesome_svg']) {
Requirements::customScript('FontAwesomeConfig={searchPseudoElements:true}');
self::loadJS('//use.fontawesome.com/releases/v'.$v.'/js/all.js');
} else {
self::loadCSS('//use.fontawesome.com/releases/v'.$v.'/css/all.css');
}
}
return self::forTemplate(); return self::forTemplate();
} }