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.
10
11
12
13
14
15
16
17
|
# File 'lib/sidebars/panel.rb', line 10
def initialize(context)
@context = context
@scope_menu = nil
@hidden_menu = nil
@menus = []
end
|
Instance Attribute Details
#context ⇒ Object
Returns the value of attribute context.
8
9
10
|
# File 'lib/sidebars/panel.rb', line 8
def context
@context
end
|
Returns the value of attribute hidden_menu.
8
9
10
|
# File 'lib/sidebars/panel.rb', line 8
def
@hidden_menu
end
|
Returns the value of attribute scope_menu.
8
9
10
|
# File 'lib/sidebars/panel.rb', line 8
def
@scope_menu
end
|
Instance Method Details
23
24
25
|
# File 'lib/sidebars/panel.rb', line 23
def ()
add_element(@menus, )
end
|
#aria_label ⇒ Object
51
52
53
|
# File 'lib/sidebars/panel.rb', line 51
def aria_label
raise NotImplementedError
end
|
19
20
21
|
# File 'lib/sidebars/panel.rb', line 19
def
end
|
#container ⇒ Object
73
74
75
|
# File 'lib/sidebars/panel.rb', line 73
def container
context.container
end
|
31
32
33
|
# File 'lib/sidebars/panel.rb', line 31
def (, )
insert_element_after(@menus, , )
end
|
27
28
29
|
# File 'lib/sidebars/panel.rb', line 27
def (, )
insert_element_before(@menus, , )
end
|
39
40
41
|
# File 'lib/sidebars/panel.rb', line 39
def ()
remove_element(@menus, )
end
|
#render? ⇒ Boolean
55
56
57
|
# File 'lib/sidebars/panel.rb', line 55
def render?
.any?
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.
89
90
91
|
# File 'lib/sidebars/panel.rb', line 89
def
end
|
Auxiliar method that helps with the migration from regular views to the new logic
79
80
81
|
# File 'lib/sidebars/panel.rb', line 79
def
end
|
59
60
61
|
# File 'lib/sidebars/panel.rb', line 59
def
@renderable_menus ||= @menus.select(&:render?)
end
|
35
36
37
|
# File 'lib/sidebars/panel.rb', line 35
def (, )
replace_element(@menus, , )
end
|
47
48
49
|
# File 'lib/sidebars/panel.rb', line 47
def ()
@hidden_menu =
end
|
43
44
45
|
# File 'lib/sidebars/panel.rb', line 43
def ()
@scope_menu =
end
|
69
70
71
|
# File 'lib/sidebars/panel.rb', line 69
def
raise NotImplementedError
end
|
Serializes every renderable menu and returns a flattened result
64
65
66
67
|
# File 'lib/sidebars/panel.rb', line 64
def
@super_sidebar_menu_items ||=
.flat_map(&:serialize_for_super_sidebar)
end
|