Module: Blacklight::OpenseadragonHelper

Defined in:
app/helpers/blacklight/openseadragon_helper.rb

Constant Summary collapse

ID_COUNTER_MAX =

Somewhat arbitrary number; the only important thing is that it is bigger than the number of embedded viewers on a page

(2**20) - 1

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.mint_idObject

Mint a (sufficiently) unique identifier, so we can associate the expand/collapse control with labels



9
10
11
12
13
14
# File 'app/helpers/blacklight/openseadragon_helper.rb', line 9

def self.mint_id
  @id_counter = ((@id_counter || 0) + 1) % ID_COUNTER_MAX

  # We convert the ID to hex for markup compactness
  @id_counter.to_s(16)
end

Instance Method Details

#osd_container_classObject



16
17
18
# File 'app/helpers/blacklight/openseadragon_helper.rb', line 16

def osd_container_class
  'col-md-6'
end

#osd_html_id_prefixObject

Deprecated.


21
22
23
# File 'app/helpers/blacklight/openseadragon_helper.rb', line 21

def osd_html_id_prefix
  "osd-#{Blacklight::OpenseadragonHelper.mint_id}".to_param
end