-
-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
bug #6697 Fix asset preloading (fracsi)
This PR was merged into the 4.x branch. Discussion ---------- Fix asset preloading Fix for #6693 Commits ------- 1a3c3c8 Fix asset preloading
- Loading branch information
Showing
2 changed files
with
6 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,6 @@ | ||
{# @var assets \EasyCorp\Bundle\EasyAdminBundle\Dto\AssetDto[] #} | ||
{% for css_asset in assets %} | ||
{% if css_asset.preload %} | ||
<link rel="preload" href="{{ ea_call_function_if_exists('preload', asset(css_asset.value, css_asset.packageName), { as: 'style', nopush: css_asset.nopush }) }}" | ||
{% for attr, value in css_asset.htmlAttributes %}{{ attr }}="{{ value|e('html_attr') }}" {% endfor %}> | ||
{% else %} | ||
<link rel="stylesheet" href="{{ asset(css_asset.value, css_asset.packageName) }}" | ||
{% for attr, value in css_asset.htmlAttributes %}{{ attr }}="{{ value|e('html_attr') }}" {% endfor %}> | ||
{% endif %} | ||
{% set href = asset(css_asset.value, css_asset.packageName) %} | ||
<link rel="stylesheet" href="{{ (css_asset.preload ? ea_call_function_if_exists('preload', href, { as: 'style', nopush: css_asset.nopush }))|default(href) }}" | ||
{% for attr, value in css_asset.htmlAttributes %}{{ attr }}="{{ value|e('html_attr') }}" {% endfor %}> | ||
{% endfor %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,6 @@ | ||
{# @var assets \EasyCorp\Bundle\EasyAdminBundle\Dto\AssetDto[] #} | ||
{% for js_asset in assets %} | ||
{% if js_asset.preload %} | ||
<link rel="preload" href="{{ ea_call_function_if_exists('preload', asset(js_asset.value, js_asset.packageName), { as: 'script', nopush: js_asset.nopush }) }}" | ||
{% for attr, value in js_asset.htmlAttributes %}{{ attr }}="{{ value|e('html_attr') }}" {% endfor %}> | ||
{% else %} | ||
<script src="{{ asset(js_asset.value, js_asset.packageName) }}" {{ js_asset.async ? 'async' }} {{ js_asset.defer ? 'defer' }} | ||
{% for attr, value in js_asset.htmlAttributes %}{{ attr }}="{{ value|e('html_attr') }}" {% endfor %}></script> | ||
{% endif %} | ||
{% set src = asset(js_asset.value, js_asset.packageName) %} | ||
<script src="{{ js_asset.preload ? ea_call_function_if_exists('preload', src, { as: 'script', nopush: js_asset.nopush })|default(src) }}" {{ js_asset.async ? 'async' }} {{ js_asset.defer ? 'defer' }} | ||
{% for attr, value in js_asset.htmlAttributes %}{{ attr }}="{{ value|e('html_attr') }}" {% endfor %}></script> | ||
{% endfor %} |