Class: FoxTail::ListGroup::ItemComponent

Inherits:
ClickableComponent
  • Object
show all
Defined in:
app/components/fox_tail/list_group/item_component.rb

Instance Method Summary collapse

Instance Method Details

#before_renderObject



50
51
52
53
54
55
56
57
# File 'app/components/fox_tail/list_group/item_component.rb', line 50

def before_render
  super

  if selected?
    html_attributes[:aria] ||= {}
    html_attributes[:aria][:current] = true
  end
end

#callObject



59
60
61
62
63
64
65
# File 'app/components/fox_tail/list_group/item_component.rb', line 59

def call
  super do
    concat visual if visual?
    concat content
    concat badge if badge?
  end
end

#hoverable?Boolean

Returns:

  • (Boolean)


42
43
44
# File 'app/components/fox_tail/list_group/item_component.rb', line 42

def hoverable?
  !static?
end

#render?Boolean

Returns:

  • (Boolean)


46
47
48
# File 'app/components/fox_tail/list_group/item_component.rb', line 46

def render?
  content?
end

#root_tag_nameObject



38
39
40
# File 'app/components/fox_tail/list_group/item_component.rb', line 38

def root_tag_name
  static? ? :div : super
end