Stabilize IDs for outfit viewer component
This commit is contained in:
parent
f9b040c20b
commit
0691153101
2 changed files with 3 additions and 1 deletions
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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),
|
||||
|
|
|
|||
Loading…
Reference in a new issue