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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ed1f29d3bce463186436db71fa5e7c764709e673
4
- data.tar.gz: 8388ed7cb48cc2160111e67918806eef9d07ce20
3
+ metadata.gz: 59162cb651a81d83a25c2f0e523dc45bec318416
4
+ data.tar.gz: '095b63cdfb2403fe0ba226a19adad7aeda77583c'
5
5
  SHA512:
6
- metadata.gz: 72991d8c0cb882768760a783b209b97a1d455a5549be960a1c247e42b7ee92b6db0721e7ca4814e2b741b345a2430ce39471ab7f590a1c3200740fdfa9005ab2
7
- data.tar.gz: 7b8e4fafbdb894826abfe260248ae722fd0f3548f9e17cdfb9e187645dd5929c61f3aef5a2b7e278655a8d7378367962518366295fa7c2e66f9096eea8d2be15
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: 'Dashboard',
33
- url: :root_path,
34
- icon: 'dashboard',
35
- html: { target: :_blank }
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[:html])
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
@@ -1,3 +1,3 @@
1
1
  module SmartNavigation
2
- VERSION = '0.1.6'
2
+ VERSION = '0.1.7'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: smart_navigation
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.6
4
+ version: 0.1.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jonian Guveli