app/helpers/pageflow/linkmap_page/areas_helper.rb in pageflow-linkmap-page-2.5.0 vs app/helpers/pageflow/linkmap_page/areas_helper.rb in pageflow-linkmap-page-2.6.0
- old
+ new
@@ -1,9 +1,10 @@
module Pageflow
module LinkmapPage
module AreasHelper
include BackgroundImageHelper
+ include RevisionFileHelper
def linkmap_content_and_background_css_classes(configuration)
hide_overlay_boxes =
configuration['mobile_panorama_navigation'] == 'pan_zoom' &&
configuration['hide_linkmap_overlay_boxes']
@@ -14,15 +15,15 @@
].compact.join(' ')
end
def linkmap_areas_div(entry, configuration)
color_map_file =
- ColorMapFile.find_by_id(configuration['linkmap_color_map_file_id'])
+ find_file_in_entry(ColorMapFile, configuration['linkmap_color_map_file_id'])
masked_hover_image_file =
- MaskedImageFile.find_by_id(configuration['linkmap_masked_hover_image_id'])
+ find_file_in_entry(MaskedImageFile, configuration['linkmap_masked_hover_image_id'])
masked_visited_image_file =
- MaskedImageFile.find_by_id(configuration['linkmap_masked_visited_image_id'])
+ find_file_in_entry(MaskedImageFile, configuration['linkmap_masked_visited_image_id'])
render('pageflow/linkmap_page/areas/div',
entry: entry,
configuration: configuration,
color_map_file: color_map_file,
@@ -35,10 +36,10 @@
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 &&
color_map_component_id.present? &&
- color_map_component_id.split(':').first.to_i == color_map_file.id
+ color_map_component_id.split(':').first.to_i == color_map_file.perma_id
background_image_div(configuration,
"linkmap_masked_#{prefix}_image",
class: "#{prefix}_image",
file_type: 'pageflow_linkmap_page_masked_image_files',
style_group: color_map_component_id.split(':').last)