effective_bootstrap 0.11.7 → 0.11.9
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: 6c71ab1abee21be75ec4450b3114102423c80406e6f4044cc2df66701a7cc240
|
4
|
+
data.tar.gz: 33d53327b54d4f4ffbf698caea2cea2054af49e00b02a897d68403beffc847b5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fad4fdfca2b4aa40955ed2a0f0a1e568d4df137a6da0286786f7d0ab5bef9a2fd5e71f170535deb388578b0fb3a264baa57e9c27c072d38c578a0c36715b3057
|
7
|
+
data.tar.gz: ef4bb529df44b363fac0588b91bdb6787571a2e1908ed58010a4faca953e540fe5dd1f874816bf275185a30eacdae403906b8956d7f4fa3ff9d882b8407ebc8d
|
@@ -20,3 +20,7 @@ $ -> EffectiveBootstrap.initialize()
|
|
20
20
|
$(document).on 'turbolinks:load', -> EffectiveBootstrap.initialize()
|
21
21
|
$(document).on 'cocoon:after-insert', -> EffectiveBootstrap.initialize()
|
22
22
|
$(document).on 'effective-bootstrap:initialize', (event) -> EffectiveBootstrap.initialize(event.currentTarget)
|
23
|
+
|
24
|
+
$(document).on 'effective-bootstrap:reinitialize', (event) ->
|
25
|
+
$(event.currentTarget).find('[data-input-js-options].initialized').removeClass('initialized')
|
26
|
+
EffectiveBootstrap.initialize(event.currentTarget)
|
@@ -325,20 +325,42 @@ module EffectiveBootstrapHelper
|
|
325
325
|
end
|
326
326
|
end
|
327
327
|
|
328
|
-
def nav_dropdown(label, right: false, link_class: [], list_class: [], &block)
|
328
|
+
def nav_dropdown(label, right: false, groups: false, link_class: [], list_class: [], &block)
|
329
329
|
raise 'expected a block' unless block_given?
|
330
330
|
|
331
331
|
id = "dropdown-#{effective_bootstrap_unique_id}"
|
332
|
+
div_class = ['dropdown-menu', *('dropdown-menu-right' if right), *('dropdown-groups' if groups)].join(' ')
|
332
333
|
|
333
334
|
content_tag(:li, class: 'nav-item dropdown') do
|
334
335
|
content_tag(:a, class: 'nav-link dropdown-toggle', href: '#', id: id, role: 'button', 'data-toggle': 'dropdown', 'aria-haspopup': true, 'aria-expanded': false) do
|
335
336
|
label.html_safe
|
336
|
-
end + content_tag(:div, class:
|
337
|
+
end + content_tag(:div, class: div_class, 'aria-labelledby': id) do
|
337
338
|
@_nav_mode = :dropdown; yield; @_nav_mode = nil
|
338
339
|
end
|
339
340
|
end
|
340
341
|
end
|
341
342
|
|
343
|
+
def nav_dropdown_group(label, unique: false, header: true, header_class: nil, &block)
|
344
|
+
raise 'expected a block' unless block_given?
|
345
|
+
|
346
|
+
div_class = [
|
347
|
+
'dropdown-group',
|
348
|
+
("dropdown-group-#{effective_bootstrap_unique_id}" if unique),
|
349
|
+
("dropdown-group-first" if label.blank?),
|
350
|
+
("dropdown-group-#{label.to_s.parameterize}" if label.present?)
|
351
|
+
].compact.join(' ')
|
352
|
+
|
353
|
+
header_class ||= 'dropdown-header'
|
354
|
+
|
355
|
+
content_tag(:div, class: div_class) do
|
356
|
+
if label.present? && header
|
357
|
+
content_tag(:h6, label, class: header_class) + capture(&block)
|
358
|
+
else
|
359
|
+
capture(&block)
|
360
|
+
end
|
361
|
+
end
|
362
|
+
end
|
363
|
+
|
342
364
|
def nav_divider
|
343
365
|
content_tag(:div, '', class: 'dropdown-divider')
|
344
366
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: effective_bootstrap
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.11.
|
4
|
+
version: 0.11.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Code and Effect
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-10-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|