smart_navigation 0.1.6 → 0.1.7
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/README.md +7 -4
- data/lib/smart_navigation/renderer.rb +3 -3
- data/lib/smart_navigation/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 59162cb651a81d83a25c2f0e523dc45bec318416
|
|
4
|
+
data.tar.gz: '095b63cdfb2403fe0ba226a19adad7aeda77583c'
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: ba40db2192c56173a156e9c7615b94c60fa59b4468ff615bdebefcd6b8cbe9a9cf39aeedf9c425a2c54acab616a6a238a8f63d67f82cb2ec9213e51cb37e936a
|
|
7
|
+
data.tar.gz: 370d3e7dcdd7641c65cfe687fd74cf14069c95433808a2596ee8924e9c8f6c21b58b64cdf0e1ba2a59787d85c4ebcf301fd427ac33b07fda4e2e1bea5e85581c
|
data/README.md
CHANGED
|
@@ -29,10 +29,11 @@ Define the menu items in a hash:
|
|
|
29
29
|
```ruby
|
|
30
30
|
@items = {
|
|
31
31
|
dashboard: {
|
|
32
|
-
label:
|
|
33
|
-
url:
|
|
34
|
-
icon:
|
|
35
|
-
html:
|
|
32
|
+
label: 'Dashboard',
|
|
33
|
+
url: :root_path,
|
|
34
|
+
icon: 'dashboard',
|
|
35
|
+
html: { target: :_blank },
|
|
36
|
+
wrapper_html: { class: 'dashboard' }
|
|
36
37
|
},
|
|
37
38
|
pages: {
|
|
38
39
|
label: 'Pages',
|
|
@@ -77,9 +78,11 @@ options = {
|
|
|
77
78
|
menu_class: 'menu',
|
|
78
79
|
menu_html: {},
|
|
79
80
|
menu_icons: true,
|
|
81
|
+
item_class: 'menu-item',
|
|
80
82
|
separator_class: 'separator',
|
|
81
83
|
submenu_parent_class: 'has-submenu',
|
|
82
84
|
submenu_class: 'submenu',
|
|
85
|
+
submenu_item_class: 'submenu-item',
|
|
83
86
|
active_class: 'active',
|
|
84
87
|
active_submenu_class: 'open',
|
|
85
88
|
submenu_icons: false,
|
|
@@ -118,9 +118,9 @@ module SmartNavigation
|
|
|
118
118
|
url = item_url(item)
|
|
119
119
|
|
|
120
120
|
if url.nil?
|
|
121
|
-
tag :a, label.html_safe
|
|
121
|
+
tag :a, label.html_safe, Hash(item[:html])
|
|
122
122
|
else
|
|
123
|
-
@context.link_to label.html_safe, url
|
|
123
|
+
@context.link_to label.html_safe, url, Hash(item[:html])
|
|
124
124
|
end
|
|
125
125
|
end
|
|
126
126
|
|
|
@@ -148,7 +148,7 @@ module SmartNavigation
|
|
|
148
148
|
active = @options[:active_class] if current_page?(item)
|
|
149
149
|
iclass = subitem ? @options[:submenu_item_class] : @options[:item_class]
|
|
150
150
|
link = item_link_tag(item, icons)
|
|
151
|
-
opts = Hash(item[:
|
|
151
|
+
opts = Hash(item[:wrapper_html])
|
|
152
152
|
opts = opts.merge(class: "#{opts[:class]} #{active} #{iclass}".strip)
|
|
153
153
|
|
|
154
154
|
tag :li, link.html_safe, opts
|