Extension: script non parser-blocking (script_tag -> <script defer>)
Sia app embed che app block caricavano il JS con il filtro script_tag (sincrono, parser-blocking -> warning ParserBlockingScript). Passato a <script defer>. Il JS ha gia' la guardia window.__recessoModalInit, quindi il doppio caricamento (embed + block sulla stessa pagina) resta sicuro.
This commit is contained in:
@@ -7,7 +7,7 @@
|
||||
{%- endcomment -%}
|
||||
|
||||
{{ 'recesso-storefront.css' | asset_url | stylesheet_tag }}
|
||||
{{ 'recesso-storefront.js' | asset_url | script_tag }}
|
||||
<script src="{{ 'recesso-storefront.js' | asset_url }}" defer></script>
|
||||
|
||||
{% if block.settings.show_link %}
|
||||
<div class="recesso-embed recesso-embed-{{ block.settings.alignment }}">
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
{%- assign rc_label = block.settings.label | default: 'Recedere dal contratto qui' -%}
|
||||
|
||||
{{ 'recesso-storefront.css' | asset_url | stylesheet_tag }}
|
||||
{% if block.settings.use_modal %}{{ 'recesso-storefront.js' | asset_url | script_tag }}{% endif %}
|
||||
{% if block.settings.use_modal %}<script src="{{ 'recesso-storefront.js' | asset_url }}" defer></script>{% endif %}
|
||||
|
||||
<div class="recesso-block recesso-align-{{ block.settings.alignment }}" {{ block.shopify_attributes }}>
|
||||
<a
|
||||
|
||||
Reference in New Issue
Block a user