simpler_navigation 0.1.5 → 0.1.6
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 +4 -4
- data/Gemfile.lock +1 -1
- data/lib/simpler_navigation/renderers/base.rb +6 -2
- data/lib/simpler_navigation/version.rb +1 -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: 17005023a740a755f9087a321deb827895193f83f93ee1c2937ac3528ec61a99
|
4
|
+
data.tar.gz: 9f7e5da8d8fcbc5488e938381617973f507ccd4b0062d074e9a652533bd2d7d0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9cb0a7b23440a2bfca1d5efd435b10566b75ea1a596e96343bfca3c4e6815d7e956287a3a53f4c4c27b3e72c519209a9f7b51acbc79e7d3ca371bca271591e50
|
7
|
+
data.tar.gz: 2ff47480a7f5ddec9f55cea3d5f925cb4197002b410a17ea80ba171daea7a11a93e68004c242004cb476da601ad23c7ad91e4b84a2b60ecd7c09157b3b7215ca
|
data/Gemfile.lock
CHANGED
@@ -7,6 +7,10 @@ module SimplerNavigation
|
|
7
7
|
include ActionView::Helpers::UrlHelper
|
8
8
|
include ActionView::Helpers::OutputSafetyHelper
|
9
9
|
|
10
|
+
attr_reader :context
|
11
|
+
attr_reader :item
|
12
|
+
attr_reader :options
|
13
|
+
|
10
14
|
def initialize(context, item, options = {})
|
11
15
|
@selected = {}
|
12
16
|
@active_leaf = {}
|
@@ -121,7 +125,7 @@ module SimplerNavigation
|
|
121
125
|
when Regexp
|
122
126
|
selected = item.options[:highlights_on].match?(@request_fullpath)
|
123
127
|
when Proc
|
124
|
-
selected = item.options[:highlights_on].call
|
128
|
+
selected = item.options[:highlights_on].call(self)
|
125
129
|
else
|
126
130
|
item_url_path = url_path(item.url).downcase
|
127
131
|
selected = @request_fullpath.downcase.start_with?(item_url_path)
|
@@ -152,7 +156,7 @@ module SimplerNavigation
|
|
152
156
|
|
153
157
|
show = true
|
154
158
|
if !item.options[:if].nil?
|
155
|
-
show = item.options[:if].call
|
159
|
+
show = item.options[:if].call(self)
|
156
160
|
elsif !item.options[:unless].nil?
|
157
161
|
show = !item.options[:unless].call
|
158
162
|
end
|