diff --git a/app/views/application/_outfit_viewer.html.haml b/app/views/application/_outfit_viewer.html.haml index 52f2e386..884646e0 100644 --- a/app/views/application/_outfit_viewer.html.haml +++ b/app/views/application/_outfit_viewer.html.haml @@ -1,4 +1,5 @@ - html_options = {} unless defined? html_options +- viewer_id = html_options[:id] ||= "outfit-viewer-#{SecureRandom.hex(8)}" = content_tag "outfit-viewer", **html_options do .loading-indicator= render partial: "hanger_spinner" @@ -14,6 +15,7 @@ - outfit.visible_layers.each do |swf_asset| %outfit-layer{ + id: "#{viewer_id}-layer-#{swf_asset.id}", data: { "asset-id": swf_asset.id, "zone": swf_asset.zone.label, diff --git a/app/views/items/show.html.haml b/app/views/items/show.html.haml index 37879734..56763663 100644 --- a/app/views/items/show.html.haml +++ b/app/views/items/show.html.haml @@ -16,7 +16,7 @@ = turbo_frame_tag "item-preview" do .preview-area - = outfit_viewer @preview_outfit + = outfit_viewer @preview_outfit, id: "item-preview-outfit-viewer" .error-indicator 💥 We couldn't load all of this outfit. Try again? = link_to wardrobe_path(params: @preview_outfit.wardrobe_params),