Skip to content

Commit

Permalink
fix slider controls showing in certain scenarios on mobile (Shopify#1973
Browse files Browse the repository at this point in the history
)
  • Loading branch information
ludoboludo authored Sep 19, 2022
1 parent d6d97c5 commit a74e1aa
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions sections/main-product.liquid
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,12 @@
assign media_count = media_count | minus: variant_images.size | plus: 1
endif

if section.settings.mobile_thumbnails == 'show' or media_count < 3 and section.settings.mobile_thumbnails == 'columns'
assign hide_slider = true
if media_count == 1 or single_media_visible
assign single_media_visible_mobile = true
endif

if media_count == 0 or single_media_visible_mobile or section.settings.mobile_thumbnails == 'show' or section.settings.mobile_thumbnails == 'columns' and media_count < 3
assign hide_mobile_slider = true
endif

if section.settings.media_size == 'large'
Expand Down Expand Up @@ -121,7 +125,7 @@
{%- endunless -%}
{%- endfor -%}
</ul>
<div class="slider-buttons no-js-hidden quick-add-hidden{% if hide_slider %} small-hide{% endif %}">
<div class="slider-buttons no-js-hidden quick-add-hidden{% if hide_mobile_slider %} small-hide{% endif %}">
<button
type="button"
class="slider-button slider-button--prev"
Expand Down

0 comments on commit a74e1aa

Please sign in to comment.