Class: Blacklight::HeaderComponent

Inherits:
Component
  • Object
show all
Defined in:
app/components/blacklight/header_component.rb

Constant Summary

Constants inherited from Component

Component::EXCLUDE_VARIABLES

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Component

compiler, config, #inspect

Constructor Details

#initialize(blacklight_config:) ⇒ HeaderComponent

Returns a new instance of HeaderComponent.



13
14
15
# File 'app/components/blacklight/header_component.rb', line 13

def initialize(blacklight_config:)
  @blacklight_config = blacklight_config
end

Instance Attribute Details

#blacklight_configObject (readonly)

Returns the value of attribute blacklight_config.



17
18
19
# File 'app/components/blacklight/header_component.rb', line 17

def blacklight_config
  @blacklight_config
end

Instance Method Details

#before_renderObject

Hack so that the default lambdas are triggered so that we don’t have to do c.with_top_bar() in the call.



21
22
23
24
# File 'app/components/blacklight/header_component.rb', line 21

def before_render
  set_slot(:top_bar, nil) unless top_bar
  set_slot(:search_bar, nil) unless search_bar
end