Class: Layout::HeaderComponent
- Inherits:
-
SparkComponents::Component
- Object
- SparkComponents::Component
- Layout::HeaderComponent
- Defined in:
- app/components/spark/layout/header_component.rb
Instance Method Summary collapse
Instance Method Details
#before_render ⇒ Object
7 8 9 |
# File 'app/components/spark/layout/header_component.rb', line 7 def before_render aria_attr(described_by: unique_id("tooltip")) if tooltip end |
#render ⇒ Object
11 12 13 14 15 16 17 18 19 20 |
# File 'app/components/spark/layout/header_component.rb', line 11 def render content_tag(:header, tag_attrs) { concat content_tag(:div, class: join_class("title")) { concat if_content_tag(:div, title, join_class: "title-content") concat tooltip_tag if tooltip concat if_content_tag(:div, badge, join_class: "badge") } concat (:div, actions, join_class: "action") } end |
#tooltip_tag ⇒ Object
22 23 24 |
# File 'app/components/spark/layout/header_component.rb', line 22 def tooltip_tag component("ui/tooltip", text: tooltip, id: aria_attr[:described_by], class: join_class("tooltip")) end |