app/helpers/pageflow/linkmap_page/areas_helper.rb in pageflow-linkmap-page-2.0.0 vs app/helpers/pageflow/linkmap_page/areas_helper.rb in pageflow-linkmap-page-2.1.0
- old
+ new
@@ -30,18 +30,19 @@
color_map_file_id: configuration['color_map_file_id']
})
end
def linkmap_area_background_image_div(prefix, attributes, configuration, color_map_file)
+ color_map_component_id = attributes['color_map_component_id'] || attributes['mask_perma_id']
if color_map_file &&
- attributes['mask_perma_id'].present? &&
- attributes['mask_perma_id'].split(':').first.to_i == color_map_file.id
+ color_map_component_id.present? &&
+ color_map_component_id.split(':').first.to_i == color_map_file.id
background_image_div(configuration,
"linkmap_masked_#{prefix}_image",
class: "#{prefix}_image",
file_type: 'pageflow_linkmap_page_masked_image_files',
- style_group: attributes['mask_perma_id'].split(':').last)
+ style_group: color_map_component_id.split(':').last)
else
background_image_div(configuration,
"#{prefix}_image",
class: "#{prefix}_image",
style_group: :panorama)
@@ -88,18 +89,19 @@
ExternalLinks::Site.find_by_revision_id_and_perma_id(entry.try(:revision),
attributes[:target_id])
end
def data_attributes
- mask_perma_id = background_type != 'hover_video' && attributes[:mask_perma_id]
+ color_map_component_id = background_type != 'hover_video' &&
+ (attributes[:color_map_component_id] || attributes[:mask_perma_id])
audio_file_id = attributes[:target_id]
{
target_type: attributes[:target_type],
target_id: attributes[:target_id],
audio_file: audio_file_id.present? ? "#{audio_file_id}.area_#{index}" : nil,
page_transition: attributes[:page_transition],
- mask_perma_id: mask_perma_id,
+ color_map_component_id: color_map_component_id,
width: attributes[:width],
height: attributes[:height]
}.delete_if { |key, value| value.blank? }
end