Class: Spark::Nav::Tree::Group

Inherits:
Group show all
Defined in:
app/components/spark/nav/tree/group.rb

Instance Method Summary collapse

Methods inherited from Group

#active?, #active_item, #beta?, #new?

Methods inherited from Component::Base

#selector, #to_s, #unique_id

Constructor Details

#initializeGroup

Returns a new instance of Group.



9
10
11
12
13
14
# File 'app/components/spark/nav/tree/group.rb', line 9

def initialize(*)
  super

  classname.base = "nav-item-wrapper"
  tag_attrs.add(role: :treeitem)
end

Instance Method Details

#expanded?Boolean

Returns:

  • (Boolean)


20
21
22
# File 'app/components/spark/nav/tree/group.rb', line 20

def expanded?
  @expanded || active?
end

#nodeObject



16
17
18
# File 'app/components/spark/nav/tree/group.rb', line 16

def node
  @title.to_s.strip.downcase.gsub(/[\W,-]+/, '_')
end