diff --git a/app/helpers/items_helper.rb b/app/helpers/items_helper.rb index c77a9bb2..31f0bfde 100644 --- a/app/helpers/items_helper.rb +++ b/app/helpers/items_helper.rb @@ -244,15 +244,5 @@ module ItemsHelper def item_header_user_lists_form_state cookies.fetch("DTIItemPageUserListsFormState", "closed") end - - def outfit_viewer_layers(swf_assets) - swf_assets.map { |a| outfit_viewer_layer(a) }.join("\n").html_safe - end - - def outfit_viewer_layer(swf_asset) - content_tag :div, class: "outfit-layer" do - image_tag swf_asset.image_url, alt: "" - end - end end diff --git a/app/views/items/show.html.haml b/app/views/items/show.html.haml index 6db54aeb..08b024f3 100644 --- a/app/views/items/show.html.haml +++ b/app/views/items/show.html.haml @@ -15,7 +15,9 @@ = turbo_frame_tag "item-preview" do .outfit-viewer - = outfit_viewer_layers @preview_outfit.visible_layers + - @preview_outfit.visible_layers.each do |swf_asset| + .outfit-layer + = image_tag swf_asset.image_url, alt: "" = form_for item_path(@item), method: :get, class: "species-color-picker", data: {"is-valid": @preview_error.nil?} do |f| @@ -40,6 +42,6 @@ %li= link_to(contributor.name, user_contributions_path(contributor)) + format_contribution_count(count) %footer= t '.contributors.footer' -- content_for :javascripts_body do - = javascript_include_tag 'item-page', defer: true +- content_for :javascripts do + = javascript_include_tag 'item-page', async: true