bootstrap-navbar 3.0.0 → 3.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/CHANGELOG.md +4 -0
- data/lib/bootstrap-navbar/helpers/bootstrap4.rb +18 -9
- data/lib/bootstrap-navbar/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 15b5f788ee43d7dfc722cf75c28e91c2cb363a36f9a58ca6968301eae9977302
|
4
|
+
data.tar.gz: a2ab4b37f4a2de21dc662ab916849b62aff4ed9dbfea4f04dae19a9206a9464c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 934a989f958b5e39c052e524ebeb49f061f6798bb02957fc464fee322848a918440efc61a6bbea102a728a7102ee784bb1decc8120a9504f58462154abb4eff6
|
7
|
+
data.tar.gz: 3d0d23275914693b2936406a955f9df128e9964e4e2361bf61c09b28b8bfca9502acd9ce4b3e84ac940f0075c91b271adc3b99f86e2cd5a0087307c96004792e
|
data/CHANGELOG.md
CHANGED
@@ -67,27 +67,36 @@ HTML
|
|
67
67
|
HTML
|
68
68
|
end
|
69
69
|
|
70
|
-
def navbar_dropdown(text,
|
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
|
-
|
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"
|
82
|
-
<div class="
|
83
|
-
|
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)
|
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.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:
|
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.
|
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
|