Skip to content

Commit

Permalink
Pass document to universal_viewer for index view.
Browse files Browse the repository at this point in the history
  • Loading branch information
tpendragon committed Aug 21, 2019
1 parent 7f9d5c8 commit ee577f8
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions app/helpers/application_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def readonly?(field)
# @param image_options [Hash]
# @return [Array<String>] an Array containing the URLs to the thumbnails
def document_thumbnail(document, image_options = {})
return unless !current_exhibit.nil? && current_exhibit.thumbnails_enabled && !universal_viewer.nil?
return unless !current_exhibit.nil? && current_exhibit.thumbnails_enabled && !universal_viewer(document).nil?

values = document.fetch(:thumbnail_ssim, nil)
return if values.empty?
Expand All @@ -78,12 +78,12 @@ def universal_viewer_installation_url

# Construct the object used to handle Universal Viewer installations
# @return [UniversalViewer]
def universal_viewer
return if @document.nil?
def universal_viewer(document = @document)
return if document.nil?

UniversalViewer.new(
universal_viewer_installation_url,
manifest: @document.manifest,
manifest: document.manifest,
config: universal_viewer_config_url
)
end
Expand Down

0 comments on commit ee577f8

Please sign in to comment.