simpler_navigation 0.1.3 → 0.1.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/simpler_navigation/renderers/base.rb +10 -5
- data/lib/simpler_navigation/version.rb +1 -1
- data/lib/simpler_navigation.rb +0 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9908cfb5f2b322d53eb970c3932ba640400e2c355737a2280d9bb7a30637b8ce
|
4
|
+
data.tar.gz: 9bb0f02a4ac18339d251823fc0e1d06f22014ea96a1f4f9269b946689395cf31
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a138ed6833abfca0ceb711e1b8d07f44bc2c922c610577c1ec0c377b7f22a992c01cf2302dc1cca764a8489e309facab2df2a507000f18c6261044722ff3e491
|
7
|
+
data.tar.gz: ba440cc7cc406c1ef9240e921d3fea646d6f8fa922800bc3be258b17a82c6b2d04da50f26b85eaeb979d512a16338bf30bfcb2e633cd4bb9ee957629898e2c7e
|
data/Gemfile.lock
CHANGED
@@ -16,6 +16,13 @@ module SimplerNavigation
|
|
16
16
|
@item = item
|
17
17
|
@options = options
|
18
18
|
|
19
|
+
@options[:level] ||= :all
|
20
|
+
|
21
|
+
@request_fullpath = context.request.fullpath
|
22
|
+
if @options[:request_fullpath]
|
23
|
+
@request_fullpath = @options[:request_fullpath]
|
24
|
+
end
|
25
|
+
|
19
26
|
if @item.nil?
|
20
27
|
case @options[:level]
|
21
28
|
when :all
|
@@ -112,14 +119,12 @@ module SimplerNavigation
|
|
112
119
|
selected = false
|
113
120
|
case item.options[:highlights_on]
|
114
121
|
when Regexp
|
115
|
-
selected = item.options[:highlights_on].match?(
|
122
|
+
selected = item.options[:highlights_on].match?(@request_fullpath)
|
116
123
|
when Proc
|
117
124
|
selected = item.options[:highlights_on].call
|
118
125
|
else
|
119
|
-
|
120
|
-
|
121
|
-
selected = SimplerNavigation.request_fullpath.downcase.start_with?(item_url_path)
|
122
|
-
end
|
126
|
+
item_url_path = url_path(item.url).downcase
|
127
|
+
selected = @request_fullpath.downcase.start_with?(item_url_path)
|
123
128
|
end
|
124
129
|
|
125
130
|
selected ||= item.children.any? do |key, value|
|
data/lib/simpler_navigation.rb
CHANGED