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
-
.mint_id ⇒ Object
Mint a (sufficiently) unique identifier, so we can associate the expand/collapse control with labels.
Instance Method Summary collapse
- #osd_container_class ⇒ Object
- #osd_html_id_prefix ⇒ Object deprecated Deprecated.
Class Method Details
.mint_id ⇒ Object
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_class ⇒ Object
16 17 18 |
# File 'app/helpers/blacklight/openseadragon_helper.rb', line 16 def osd_container_class 'col-md-6' end |
#osd_html_id_prefix ⇒ Object
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 |