bootstrap-navbar 1.0.0.pre5 → 1.0.0.pre6
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 747804f867d7733cc7d2017d150c251c697f7d7b
|
4
|
+
data.tar.gz: 52bb44678ab9b4d832892e10bbf40c3626f48a25
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f489bfdef9f57536f29361de3f3b362e6b286f7e6b8f35aea252d9c96ef1997163a57c8ef6d15c0bc116b530944e2c1c931cda365257da4b29073b0404cbc36a
|
7
|
+
data.tar.gz: cd3160ef9e88939818289d9ecb1d45ed29151d62c46f9cb3613d8e39a6caabd881d0912f0f5937520add2a45d8728eef723cbdaf8c8b9a00e77ff279dc21a234
|
@@ -1,6 +1,6 @@
|
|
1
1
|
module BootstrapNavbar::Helpers::Bootstrap2
|
2
|
-
def navbar(options = {}, &block)
|
3
|
-
wrapper options do
|
2
|
+
def navbar(options = {}, wrapper_options = {}, &block)
|
3
|
+
wrapper options, wrapper_options do
|
4
4
|
inner_wrapper do
|
5
5
|
container options[:brand], options[:brand_link], options[:responsive], options[:fluid], &block
|
6
6
|
end
|
@@ -101,7 +101,7 @@ HTML
|
|
101
101
|
|
102
102
|
private
|
103
103
|
|
104
|
-
def wrapper(options, &block)
|
104
|
+
def wrapper(options, html_options, &block)
|
105
105
|
position = case
|
106
106
|
when options.has_key?(:static)
|
107
107
|
"static-#{options[:static]}"
|
@@ -112,8 +112,9 @@ HTML
|
|
112
112
|
css_classes = %w(navbar).tap do |css_classes|
|
113
113
|
css_classes << "navbar-#{position}" if position
|
114
114
|
css_classes << 'navbar-inverse' if options[:inverse]
|
115
|
+
css_classes << html_options.delete(:class)
|
115
116
|
end
|
116
|
-
attribute_hash = { class: css_classes.join(' ') }
|
117
|
+
attribute_hash = { class: css_classes.join(' ') }.merge(html_options)
|
117
118
|
attributes = attributes_for_tag(attribute_hash)
|
118
119
|
|
119
120
|
prepare_html <<-HTML.chomp!
|
@@ -107,6 +107,14 @@ describe BootstrapNavbar::Helpers::Bootstrap2 do
|
|
107
107
|
end
|
108
108
|
end
|
109
109
|
end
|
110
|
+
|
111
|
+
context 'with wrapper parameters' do
|
112
|
+
it 'generates the correct HTML' do
|
113
|
+
with_all_2_dot_x_versions do
|
114
|
+
expect(renderer.navbar({}, class: 'my-wrapper-class', id: 'my-wrapper-id')).to have_tag(:div, with: { class: 'navbar my-wrapper-class', id: 'my-wrapper-id' })
|
115
|
+
end
|
116
|
+
end
|
117
|
+
end
|
110
118
|
end
|
111
119
|
|
112
120
|
describe '#navbar_group' do
|