Class: Geoblacklight::IiifDragDropComponent

Inherits:
ViewComponent::Base
  • Object
show all
Defined in:
app/components/geoblacklight/iiif_drag_drop_component.rb

Instance Method Summary collapse

Constructor Details

#initialize(document:) ⇒ IiifDragDropComponent

Returns a new instance of IiifDragDropComponent.



5
6
7
8
9
10
# File 'app/components/geoblacklight/iiif_drag_drop_component.rb', line 5

def initialize(document:)
  super()
  manifest_ref = document.item_viewer&.iiif_manifest
  @manifest = manifest_ref&.endpoint || ""
  @href_link = Settings.IIIF_DRAG_DROP_LINK&.gsub("@manifest", @manifest)
end

Instance Method Details

#render?Boolean

Returns:

  • (Boolean)


12
13
14
# File 'app/components/geoblacklight/iiif_drag_drop_component.rb', line 12

def render?
  Settings.IIIF_DRAG_DROP_LINK.present? && @manifest.present?
end