simpler_navigation 0.1.1 → 0.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 626e64edbed0821098ffb7e9f41ea482af4c902d6cfd1390d57c307906aaced8
|
|
4
|
+
data.tar.gz: 4c3ee2f62d975d7cc1c4d6c1de00650479e2acf0bad15f492b92f19e5f2e66df
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: bd5187bbfa35c31aff30a0440b4f61edc3fe579cd98e791baacfada451802ed412eb781f063e8582e74686fe24155cd6dae1a59706c1361c3af6cec8244ca84c
|
|
7
|
+
data.tar.gz: 158cdb352ec4541741babcc8684106115a5915a33693af17dcf8670e65ad096adcec4f98fe329183e536cc32c97413f48c3398652c1edce997acaa8fc3496e1f
|
data/Gemfile.lock
CHANGED
|
@@ -66,6 +66,9 @@ module SimplerNavigation
|
|
|
66
66
|
classes << SimplerNavigation.config.selected_class
|
|
67
67
|
end
|
|
68
68
|
options[:class] = classes.compact.join(" ")
|
|
69
|
+
if options[:class].empty?
|
|
70
|
+
options.delete(:class)
|
|
71
|
+
end
|
|
69
72
|
|
|
70
73
|
options
|
|
71
74
|
end
|
|
@@ -88,6 +91,9 @@ module SimplerNavigation
|
|
|
88
91
|
classes << SimplerNavigation.config.active_leaf_class
|
|
89
92
|
end
|
|
90
93
|
options[:class] = classes.compact.join(" ")
|
|
94
|
+
if options[:class].empty?
|
|
95
|
+
options.delete(:class)
|
|
96
|
+
end
|
|
91
97
|
|
|
92
98
|
options
|
|
93
99
|
end
|
|
@@ -114,10 +120,10 @@ module SimplerNavigation
|
|
|
114
120
|
item_url_path = url_path(item.url).downcase
|
|
115
121
|
selected = SimplerNavigation.request_fullpath.downcase.start_with?(item_url_path)
|
|
116
122
|
end
|
|
123
|
+
end
|
|
117
124
|
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
end
|
|
125
|
+
selected ||= item.children.any? do |key, value|
|
|
126
|
+
selected?(value)
|
|
121
127
|
end
|
|
122
128
|
|
|
123
129
|
@selected[item] = selected
|
|
@@ -141,23 +147,9 @@ module SimplerNavigation
|
|
|
141
147
|
|
|
142
148
|
show = true
|
|
143
149
|
if !item.options[:if].nil?
|
|
144
|
-
show =
|
|
145
|
-
when false
|
|
146
|
-
false
|
|
147
|
-
when true
|
|
148
|
-
true
|
|
149
|
-
else
|
|
150
|
-
item.options[:if].call
|
|
151
|
-
end
|
|
150
|
+
show = item.options[:if].call
|
|
152
151
|
elsif !item.options[:unless].nil?
|
|
153
|
-
show =
|
|
154
|
-
when false
|
|
155
|
-
true
|
|
156
|
-
when true
|
|
157
|
-
false
|
|
158
|
-
else
|
|
159
|
-
!item.options[:unless].call
|
|
160
|
-
end
|
|
152
|
+
show = !item.options[:unless].call
|
|
161
153
|
end
|
|
162
154
|
|
|
163
155
|
@show[item] = show
|