Class: Layout::HeaderComponent

Inherits:
SparkComponents::Component
  • Object
show all
Defined in:
app/components/spark/layout/header_component.rb

Instance Method Summary collapse

Instance Method Details

#before_renderObject



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

#renderObject



11
12
13
14
15
16
17
18
19
20
# File 'app/components/spark/layout/header_component.rb', line 11

def render
  (:header, tag_attrs) {
    concat (:div, class: join_class("title")) {
      concat (:div, title, join_class: "title-content")
      concat tooltip_tag if tooltip
      concat (:div, badge, join_class: "badge")
    }
    concat (:div, actions, join_class: "action")
  }
end

#tooltip_tagObject



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