mirror of
https://github.com/a2nt/cms-niceties.git
synced 2024-10-22 09:05:46 +00: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']
|
$v = !isset($config['fontawesome_version']) || !$config['fontawesome_version']
|
||||||
? Config::inst()->get(FontAwesomeField::class, 'version')
|
? Config::inst()->get(FontAwesomeField::class, 'version')
|
||||||
: $config['fontawesome_version'];
|
: $config['fontawesome_version'];
|
||||||
|
|
||||||
self::loadJS('//use.fontawesome.com/releases/v'.$v.'/js/all.js');
|
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
|
public static function loadCSS($css): void
|
||||||
{
|
{
|
||||||
$external = (mb_strpos($css, '//') === 0 || mb_strpos($css, 'http') === 0);
|
$external = (mb_strpos($css, '//') === 0 || mb_strpos($css, 'http') === 0);
|
||||||
if ($external) {
|
if (self::getDeferred() && !self::webpackActive()) {
|
||||||
self::$css[] = $css;
|
self::$css[] = $css;
|
||||||
} else {
|
} else {
|
||||||
WebpackTemplateProvider::loadCSS($css);
|
WebpackTemplateProvider::loadCSS($css);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user