effective_bootstrap 0.6.25 → 0.6.30

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: 9bd272496df4534d4a096a99118c4614a09c4abcead6472e8fe35e4afac69750
4
- data.tar.gz: cda866751363becaed7667b5b6b170d86170627239931e4d760f64df4f5c149d
3
+ metadata.gz: cea2d98355204f9fbffa818109b13fb58cdf6fb06bf3d9fd0aa5edc5c9e83f8d
4
+ data.tar.gz: f76f2322ea5d270db922b6b9bf7f81912206290cf36c900284265e3b5e5bab84
5
5
  SHA512:
6
- metadata.gz: 7ca2b6237032c11011187f82108888f44592d083b413048351b7784acb632f26612cac669b71cf025c9b2c2651e5e674d7cce10d0417637449a8453e82b8f31a
7
- data.tar.gz: 15c5474cd55dfd1c5d6239448041195833ad078920a312a3afba3c50df99691cff19c40c086fae55e9f51b3270747c30f71412da0bccaf2da0522bb59cee5dbe
6
+ metadata.gz: 5bd53873dbec00c9e902de0e296a5ece80f110bf83433904c16efdea22d0344d1c4e2109d1dfa51c14309c311b5e4611942cf705da9bc3a76f369fbff6ddd867
7
+ data.tar.gz: 6558d15ea204361d5c3642f5b02668d382af5966d0a1714f070c238b5496aaec198267a58f770776c572499d96da8c0a2de0db0354a73a41bff4d19bc986c938
@@ -2,7 +2,14 @@
2
2
  $affects = $element.closest('form').find("input[name='#{options.name}'],select[name='#{options.name}']")
3
3
 
4
4
  $affects.on 'change', (event) ->
5
- if $(event.target).val() == options.value
5
+ $target = $(event.target)
6
+ matches = ($target.val() == options.value)
7
+
8
+ if $target.is("[type='checkbox']")
9
+ matches = matches || ($target.is(':checked') && "#{options.value}" == 'true')
10
+ matches = matches || (!$target.is(':checked') && ("#{options.value}" == 'false' || "#{options.value}" == ''))
11
+
12
+ if matches
6
13
  $element.hide()
7
14
  $element.find('input,textarea,select').prop('disabled', true)
8
15
  else
@@ -18,7 +25,14 @@
18
25
  $affects = $element.closest('form').find("input[name='#{options.name}'],select[name='#{options.name}']")
19
26
 
20
27
  $affects.on 'change', (event) ->
21
- if $(event.target).val() == options.value
28
+ $target = $(event.target)
29
+ matches = ($target.val() == options.value)
30
+
31
+ if $target.is("[type='checkbox']")
32
+ matches = matches || ($target.is(':checked') && "#{options.value}" == 'true')
33
+ matches = matches || (!$target.is(':checked') && ("#{options.value}" == 'false' || "#{options.value}" == ''))
34
+
35
+ if matches
22
36
  $element.fadeIn()
23
37
  $element.find('input,textarea,select').removeAttr('disabled')
24
38
  else
@@ -1,16 +1,14 @@
1
- let initTabs = function() {
2
- let $tab_with_error = $(".form-control.is-invalid").first().closest('.tab-pane');
1
+ $(document).ready(function() {
2
+ var $tab_with_error = $(".form-control.is-invalid").first().closest('.tab-pane');
3
3
 
4
4
  if ($tab_with_error.length > 0) {
5
5
  $(".nav.nav-tabs").find("a[href^='#" + $tab_with_error.attr('id') + "']").tab('show');
6
6
  } else if (document.location.hash.length > 0) {
7
- let $tab_from_url = $(".nav.nav-tabs").find("a[href^='" + document.location.hash + "']");
7
+ var $tab_from_url = $(".nav.nav-tabs").find("a[href^='" + document.location.hash + "']");
8
8
 
9
9
  if ($tab_from_url.length > 0) {
10
10
  document.location.hash = ""; // This prevents scrolling to the wrong place in the page
11
11
  $tab_from_url.tab("show");
12
12
  }
13
13
  }
14
- }
15
-
16
- $(document).ready(initTabs);
14
+ });
@@ -37,7 +37,7 @@ module EffectiveBootstrapHelper
37
37
 
38
38
  link_opts[:class] = opts.delete(:link_class) || 'btn btn-link'
39
39
  div_class = opts.delete(:div_class)
40
- card_class = opts.delete(:card_class) || 'my-2'
40
+ card_class = opts.delete(:card_class) || 'card card-body my-2'
41
41
 
42
42
  if @_accordion_active
43
43
  # Accordion collapse
@@ -55,7 +55,7 @@ module EffectiveBootstrapHelper
55
55
  # Normal collapse
56
56
  content_tag(:a, label, link_opts) +
57
57
  content_tag(:div, id: id, class: ['collapse', div_class, ('show' if show)].compact.join(' ')) do
58
- content_tag(:div, capture(&block), class: ['card', 'card-body', card_class].compact.join(' '))
58
+ content_tag(:div, capture(&block), class: card_class)
59
59
  end
60
60
  end
61
61
  end
@@ -77,7 +77,9 @@ module Effective
77
77
  end
78
78
 
79
79
  if options_collection.kind_of?(Hash)
80
- options_collection[include_null] = [[include_null, 'nil']]
80
+ options_collection[include_null] = [
81
+ Struct.new(:to_s, :id, :first, :second).new(include_null, 'nil', include_null, 'nil')
82
+ ]
81
83
  end
82
84
 
83
85
  options_collection
@@ -1,3 +1,3 @@
1
1
  module EffectiveBootstrap
2
- VERSION = '0.6.25'.freeze
2
+ VERSION = '0.6.30'.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.6.25
4
+ version: 0.6.30
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: 2020-05-08 00:00:00.000000000 Z
11
+ date: 2020-05-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails