Skip to content

Commit

Permalink
Make sure first image is not lazy loaded
Browse files Browse the repository at this point in the history
  • Loading branch information
baldurh committed Jan 30, 2022
1 parent c52792c commit 7530d2e
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion sections/main-product.liquid
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,11 @@
{%- unless media.id == product.selected_or_first_available_variant.featured_media.id -%}
<li id="Slide-{{ section.id }}-{{ media.id }}" class="product__media-item grid__item slider__slide{% if product.selected_or_first_available_variant.featured_media == null and forloop.index == 1 %} is-active{% endif %}{% if media.media_type != 'image' %} product__media-item--full{% endif %}{% if section.settings.hide_variants and variant_images contains media.src %} product__media-item--variant{% endif %}" data-media-id="{{ section.id }}-{{ media.id }}">
{%- assign media_position = media_position | default: 0 | plus: 1 -%}
{% render 'product-thumbnail', media: media, position: media_position, loop: section.settings.enable_video_looping, modal_id: section.id, xr_button: true, media_width: media_width, lazy_load: true %}
{%- assign lazy_load = false -%}
{%- if media_position > 1 -%}
{%- assign lazy_load = true -%}
{%- endif -%}
{% render 'product-thumbnail', media: media, position: media_position, loop: section.settings.enable_video_looping, modal_id: section.id, xr_button: true, media_width: media_width, lazy_load: lazy_load %}
</li>
{%- endunless -%}
{%- endfor -%}
Expand Down

0 comments on commit 7530d2e

Please sign in to comment.