bootstrap-navbar 3.0.3 → 3.0.4
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a7672f76fb3d9804811d5e76193473f84b9a6c098df2407481d11a0cf8faf69a
|
4
|
+
data.tar.gz: bc88570acfb419681764a420d7be1e34fa98e70e94fda91429a3b53d5c577c06
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ae5680d5d6dd7930d69914673bbf920556e615a9b3f4b7b0dcf543b74b6fb15799a4f4858cac5eb71c69e7d13535f0409cc71e053ba9c32360583c9cc80ee62d
|
7
|
+
data.tar.gz: af6c272f6fb2f21c38a93c374ad172c6bc41ae28193747c70adfc4ecf9f073af23b0376bc7f600158c7963abc8a4f663e2bd43a3a8878d375193f25200ea4100
|
@@ -70,6 +70,7 @@ HTML
|
|
70
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
|
+
wrapper_class = [*list_item_options.delete(:wrapper_class), 'dropdown-menu'].compact.join(' ')
|
73
74
|
list_item_attributes = attributes_for_tag(list_item_options)
|
74
75
|
link_options[:class] = [link_options[:class], 'nav-link', 'dropdown-toggle'].compact.join(' ')
|
75
76
|
id ||= "navbarDropdownMenuLink#{text}"
|
@@ -77,7 +78,7 @@ HTML
|
|
77
78
|
prepare_html <<-HTML.chomp!
|
78
79
|
<li#{list_item_attributes}>
|
79
80
|
<a href="#" data-toggle="dropdown" id="##{id}" aria-haspopup="true" aria-expanded="false" role="button" #{link_attributes}>#{text}</a>
|
80
|
-
<div class="
|
81
|
+
<div class="#{wrapper_class}" aria-labelledby="#{id}">
|
81
82
|
#{capture(&block) if block_given?}
|
82
83
|
</div>
|
83
84
|
</li>
|
@@ -141,4 +141,22 @@ describe BootstrapNavbar::Helpers::Bootstrap4 do
|
|
141
141
|
end
|
142
142
|
end
|
143
143
|
end
|
144
|
+
|
145
|
+
describe '#navbar_dropdown' do
|
146
|
+
context 'with block' do
|
147
|
+
it 'generates the correct HTML' do
|
148
|
+
expect(renderer.navbar_dropdown('Foo', 'foo') { 'link-text' }).to have_tag(:li, with: { class: 'nav-item dropdown'}) do
|
149
|
+
with_tag :div, with: { class: 'dropdown-menu' }
|
150
|
+
end
|
151
|
+
end
|
152
|
+
end
|
153
|
+
|
154
|
+
context 'with right aligned menu' do
|
155
|
+
it 'generates the correct HTML' do
|
156
|
+
expect(renderer.navbar_dropdown('Foo', 'foo', { wrapper_class: 'dropdown-menu-right' }) { 'link-text' }).to have_tag(:li, with: { class: 'nav-item dropdown' }) do
|
157
|
+
with_tag :div, with: { class: 'dropdown-menu dropdown-menu-right' }
|
158
|
+
end
|
159
|
+
end
|
160
|
+
end
|
161
|
+
end
|
144
162
|
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.
|
4
|
+
version: 3.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Manuel Meurer
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-10-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|