bootstrap-navbar 3.0.0 → 3.0.1

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
- SHA1:
3
- metadata.gz: 8c291f029a11735de42e487164788cb86bbaa462
4
- data.tar.gz: 6e8c0b30ba8104a7d88c1cf145bbb42d82855e15
2
+ SHA256:
3
+ metadata.gz: 15b5f788ee43d7dfc722cf75c28e91c2cb363a36f9a58ca6968301eae9977302
4
+ data.tar.gz: a2ab4b37f4a2de21dc662ab916849b62aff4ed9dbfea4f04dae19a9206a9464c
5
5
  SHA512:
6
- metadata.gz: b2351d96b24a8637500d987bf290907659fdce0bc5d096d2a86442b03e69b9ffa488dfd7b8dfcfb4348dd7e9f6ecabb4b419c722961a7877c2b564c4392dc0d9
7
- data.tar.gz: dc7e7ddd9a4aa90c073058bcc639fec8ba36e0cb16411e7c2050e203e81a9f9a921f2f739a4db5de0061ce9b990c3093a5008ae45d336611e52d94f1e3b80f0d
6
+ metadata.gz: 934a989f958b5e39c052e524ebeb49f061f6798bb02957fc464fee322848a918440efc61a6bbea102a728a7102ee784bb1decc8120a9504f58462154abb4eff6
7
+ data.tar.gz: 3d0d23275914693b2936406a955f9df128e9964e4e2361bf61c09b28b8bfca9502acd9ce4b3e84ac940f0075c91b271adc3b99f86e2cd5a0087307c96004792e
@@ -1,3 +1,7 @@
1
+ ## 3.0.0
2
+
3
+ * Add support for Bootstrap 4 (for real) - big thanks to Sebastian Menhofer! (https://github.com/bootstrap-ruby/bootstrap-navbar/pull/13)
4
+
1
5
  ## 2.4.0
2
6
 
3
7
  * Add support for `root_paths` configuration
@@ -67,27 +67,36 @@ HTML
67
67
  HTML
68
68
  end
69
69
 
70
- def navbar_dropdown(text, target = '', list_item_options = {}, link_options = {}, ul_options = {}, &block)
70
+ def navbar_dropdown(text, id = '', list_item_options = {}, link_options = {}, &block)
71
71
  list_item_options, link_options = list_item_options.dup, link_options.dup
72
72
  list_item_options[:class] = [list_item_options[:class], 'nav-item', 'dropdown'].compact.join(' ')
73
73
  list_item_attributes = attributes_for_tag(list_item_options)
74
74
  link_options[:class] = [link_options[:class], 'nav-link', 'dropdown-toggle'].compact.join(' ')
75
- target ||= "navbarDropdownMenuLink#{text}"
75
+ id ||= "navbarDropdownMenuLink#{text}"
76
76
  link_attributes = attributes_for_tag(link_options)
77
- ul_options[:class] = [ul_options[:class], 'nav'].compact.join(' ')
78
- ul_attributes = attributes_for_tag(ul_options)
79
77
  prepare_html <<-HTML.chomp!
80
78
  <li#{list_item_attributes}>
81
- <a href="#" data-toggle="dropdown" data-target="##{target}"#{link_attributes}>#{text} <b class="caret"></b></a>
82
- <div class="collapse" id="#{target}">
83
- <ul#{ul_attributes}>
84
- #{capture(&block) if block_given?}
85
- </ul>
79
+ <a href="#" data-toggle="dropdown" id="##{id}" aria-haspopup="true" aria-expanded="false" role="button" #{link_attributes}>#{text}</a>
80
+ <div class="dropdown-menu" aria-labelledby="#{id}">
81
+ #{capture(&block) if block_given?}
86
82
  </div>
87
83
  </li>
88
84
  HTML
89
85
  end
90
86
 
87
+ def navbar_dropdown_item(text, url = '#', link_options = {}, &block)
88
+ link_options = link_options.dup
89
+ link_options[:class] = [link_options[:class], 'dropdown-item'].compact
90
+ link_options[:class] << 'active' if current_url_or_sub_url?(url)
91
+ link_options[:class] = link_options[:class].join(' ')
92
+ link_attributes = attributes_for_tag(link_options)
93
+ prepare_html <<~HTML.chomp!
94
+ <a href="#{url}"#{link_attributes}>
95
+ #{text}
96
+ </a>
97
+ HTML
98
+ end
99
+
91
100
  private
92
101
 
93
102
  def container(&block)
@@ -1,3 +1,3 @@
1
1
  module BootstrapNavbar
2
- VERSION = '3.0.0'
2
+ VERSION = '3.0.1'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bootstrap-navbar
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.0
4
+ version: 3.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Manuel Meurer
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-10-18 00:00:00.000000000 Z
11
+ date: 2018-02-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -169,7 +169,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
169
169
  version: '0'
170
170
  requirements: []
171
171
  rubyforge_project:
172
- rubygems_version: 2.6.13
172
+ rubygems_version: 2.7.5
173
173
  signing_key:
174
174
  specification_version: 4
175
175
  summary: Helpers to generate a Bootstrap style navbar