Class: Sidebars::Panel
Instance Attribute Summary collapse
Instance Method Summary
collapse
extended, extensions, included, method_added, override, prepended, queue_verification, verify!
#add_element, #insert_element_after, #insert_element_before, #remove_element, #replace_element
Constructor Details
#initialize(context) ⇒ Panel
Returns a new instance of Panel.
11
12
13
14
15
16
17
18
|
# File 'lib/sidebars/panel.rb', line 11
def initialize(context)
@context = context
@scope_menu = nil
@hidden_menu = nil
@menus = []
end
|
Instance Attribute Details
#context ⇒ Object
Returns the value of attribute context.
9
10
11
|
# File 'lib/sidebars/panel.rb', line 9
def context
@context
end
|
Returns the value of attribute hidden_menu.
9
10
11
|
# File 'lib/sidebars/panel.rb', line 9
def
@hidden_menu
end
|
Returns the value of attribute scope_menu.
9
10
11
|
# File 'lib/sidebars/panel.rb', line 9
def
@scope_menu
end
|
Instance Method Details
24
25
26
|
# File 'lib/sidebars/panel.rb', line 24
def ()
add_element(@menus, )
end
|
#aria_label ⇒ Object
52
53
54
|
# File 'lib/sidebars/panel.rb', line 52
def aria_label
raise NotImplementedError
end
|
20
21
22
|
# File 'lib/sidebars/panel.rb', line 20
def
end
|
#container ⇒ Object
64
65
66
|
# File 'lib/sidebars/panel.rb', line 64
def container
context.container
end
|
56
57
58
|
# File 'lib/sidebars/panel.rb', line 56
def
.any?
end
|
32
33
34
|
# File 'lib/sidebars/panel.rb', line 32
def (, )
insert_element_after(@menus, , )
end
|
28
29
30
|
# File 'lib/sidebars/panel.rb', line 28
def (, )
insert_element_before(@menus, , )
end
|
40
41
42
|
# File 'lib/sidebars/panel.rb', line 40
def ()
remove_element(@menus, )
end
|
Auxiliar method that helps with the migration from regular views to the new logic.
Any menu inside this partial will be added after all the menus added in the `configure_menus` method.
80
81
82
|
# File 'lib/sidebars/panel.rb', line 80
def
end
|
Auxiliar method that helps with the migration from regular views to the new logic
70
71
72
|
# File 'lib/sidebars/panel.rb', line 70
def
end
|
60
61
62
|
# File 'lib/sidebars/panel.rb', line 60
def
@renderable_menus ||= @menus.select(&:render?)
end
|
36
37
38
|
# File 'lib/sidebars/panel.rb', line 36
def (, )
replace_element(@menus, , )
end
|
48
49
50
|
# File 'lib/sidebars/panel.rb', line 48
def ()
@hidden_menu =
end
|
44
45
46
|
# File 'lib/sidebars/panel.rb', line 44
def ()
@scope_menu =
end
|