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: 68548522518889e81c7f8faeb660735da060c292e28edebb0949c66371f756de
4
- data.tar.gz: bb2bff2c081b9ccf066159a1f7f809ced32d0b0dad5a8fb22694665e9d903a01
3
+ metadata.gz: 6c71ab1abee21be75ec4450b3114102423c80406e6f4044cc2df66701a7cc240
4
+ data.tar.gz: 33d53327b54d4f4ffbf698caea2cea2054af49e00b02a897d68403beffc847b5
5
5
  SHA512:
6
- metadata.gz: 031537776b1509754c847973bc9575e376d28e57a2e7e95f349569811cca76956763ed3ebcafd6ea1309dc0c009dbc6f2720b2f03a4664a561496c162d653c61
7
- data.tar.gz: a075bb4fb9a325529269660716ac3e6716764eabb5c0b31f7c79b34290d835922a556cd1c96c05853a4017aab863afaa28d3cc3b840a3f0d4c90916fc5db643b
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: (right ? 'dropdown-menu dropdown-menu-right' : 'dropdown-menu'), 'aria-labelledby': id) do
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
@@ -1,3 +1,3 @@
1
1
  module EffectiveBootstrap
2
- VERSION = '0.11.7'.freeze
2
+ VERSION = '0.11.9'.freeze
3
3
  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.7
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-09-22 00:00:00.000000000 Z
11
+ date: 2022-10-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails