releaf-core 1.1.11 → 1.1.12
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/builders/releaf/builders/page/menu_builder.rb +3 -7
- data/app/lib/releaf/controller_definition.rb +4 -0
- data/app/lib/releaf/controller_group_definition.rb +4 -0
- data/spec/lib/releaf/controller_definition_spec.rb +6 -0
- data/spec/lib/releaf/controller_group_definition_spec.rb +6 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 774aa55ef930837a7e646278f436c3fe676ecb97
|
4
|
+
data.tar.gz: 5fb2eaaa8ac74dc233a5cbe37ce9da17eeb84c2d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 05b5fe1d0263450f196132267005e31814af72959b6bd9c497d6f5dd1a356f0a066eb4448476f2a83cad9455e4cba85574e95acc1f172cc0f6dd03978929280e
|
7
|
+
data.tar.gz: 444fa055b95f9801ef4ba5ee5ace5347bcdfb9bf53084d3eb16342457074607d2ae7e1609483ddb3530289ca0f7f239c9ed86e9e569be2ee9f781a3c5c1c97a3
|
@@ -10,7 +10,7 @@ module Releaf::Builders::Page
|
|
10
10
|
|
11
11
|
def active?(item)
|
12
12
|
instance_cache("active_#{item.class.name}_#{item.name}") do
|
13
|
-
if
|
13
|
+
if item.group?
|
14
14
|
item.controllers.find{|subitem| active?(subitem) }.present?
|
15
15
|
else
|
16
16
|
item.controller_name == controller.short_name
|
@@ -25,7 +25,7 @@ module Releaf::Builders::Page
|
|
25
25
|
|
26
26
|
def menu_item(item)
|
27
27
|
tag(:li, item_attributes(item)) do
|
28
|
-
if
|
28
|
+
if item.group?
|
29
29
|
menu_item_group(item)
|
30
30
|
else
|
31
31
|
menu_item_single(item)
|
@@ -33,10 +33,6 @@ module Releaf::Builders::Page
|
|
33
33
|
end
|
34
34
|
end
|
35
35
|
|
36
|
-
def controller_group?(item)
|
37
|
-
item.respond_to? :controllers
|
38
|
-
end
|
39
|
-
|
40
36
|
def menu_item_single(item)
|
41
37
|
tag(:a, class: "trigger", href: item.path) do
|
42
38
|
item_name_content(item)
|
@@ -50,7 +46,7 @@ module Releaf::Builders::Page
|
|
50
46
|
end
|
51
47
|
|
52
48
|
def collapsed_item?(item)
|
53
|
-
|
49
|
+
item.group? && !active?(item) && layout_settings("releaf.menu.collapsed.#{item.name}") == true
|
54
50
|
end
|
55
51
|
|
56
52
|
def item_attributes(item)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: releaf-core
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.12
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- CubeSystems
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-01-
|
11
|
+
date: 2018-01-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|