effective_bootstrap 1.18.5 → 1.18.7

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: 994272ae1c8f836bfb67d441e7fb17a7a2077cd2668af0cf03f754d07e3e532f
4
- data.tar.gz: 48d354f2dd4b17642522259789e469374cdfb6792f4b8a44f51a22da5801517e
3
+ metadata.gz: e2fadb33191774f48f85f53dc2c3a24b98d885b73e686d7e6cb41d06bdd6e9c7
4
+ data.tar.gz: bd46fbe4dbee25ce4e1b63c64b63cba8d751789aa0d7ab6cf1fb1776ef021d21
5
5
  SHA512:
6
- metadata.gz: 8551d67dbdc2298695d99e370466f21be42141cce73c3841891504c3a0b6c4cce80e0072efe73f92b2f8e215ad129dfd8a979318fd874615c2975ae258ce61b9
7
- data.tar.gz: e042e706fe9071887df34c572be5ef396a9ff53127542ae23efd2e88a05b4f8fd4f5e12efc8d3ea17b011e200100bbea62e0c3f6bb828642b17204d93c554921
6
+ metadata.gz: dbaf684821074f0ca879e88c3e3cfe6a61dc583600addb0d52d9d3596472156da09ac86371ec8bd460c82bd155431673d86a4b82d8a12e22c5f4519c0df409f7
7
+ data.tar.gz: ccb1286eb4a0d00aaed5642bc2c8cb77264c70e926370f2e723e9291e0af95b561406ca221833dbf7b71b7ea2159243dc6d684f27a130ce813ba028dd92eb1ff
@@ -1,7 +1,12 @@
1
1
  elementSelector = 'input,textarea,select,button,div.form-has-many'
2
2
 
3
3
  (this.EffectiveBootstrap || {}).effective_hide_if = ($element, options) ->
4
- $affects = $element.closest('form,div.effective-datatables-filters').find("input[name='#{options.name}'],select[name='#{options.name}']")
4
+ if options.nested
5
+ $container = $element.parent('div.effective-form-logic') || $element.closest('form,div.effective-datatables-filters')
6
+ else
7
+ $container = $element.closest('form,div.effective-datatables-filters')
8
+
9
+ $affects = $container.find("input[name='#{options.name}'],select[name='#{options.name}'],input[name='#{options.name}[]']")
5
10
 
6
11
  $affects.on 'change', (event) ->
7
12
  $target = $(event.target)
@@ -24,7 +29,12 @@ elementSelector = 'input,textarea,select,button,div.form-has-many'
24
29
  $element.find(elementSelector).prop('disabled', true)
25
30
 
26
31
  (this.EffectiveBootstrap || {}).effective_show_if = ($element, options) ->
27
- $affects = $element.closest('form,div.effective-datatables-filters').find("input[name='#{options.name}'],select[name='#{options.name}'],input[name='#{options.name}[]']")
32
+ if options.nested
33
+ $container = $element.parent('div.effective-form-logic') || $element.closest('form,div.effective-datatables-filters')
34
+ else
35
+ $container = $element.closest('form,div.effective-datatables-filters')
36
+
37
+ $affects = $container.find("input[name='#{options.name}'],select[name='#{options.name}'],input[name='#{options.name}[]']")
28
38
 
29
39
  $affects.on 'change', (event) ->
30
40
  $target = $(event.target)
@@ -51,7 +61,13 @@ elementSelector = 'input,textarea,select,button,div.form-has-many'
51
61
  $element.find(elementSelector).prop('disabled', true)
52
62
 
53
63
  (this.EffectiveBootstrap || {}).effective_show_if_any = ($element, options) ->
54
- $affects = $element.closest('form,div.effective-datatables-filters').find("input[name='#{options.name}'],select[name='#{options.name}']")
64
+ if options.nested
65
+ $container = $element.parent('div.effective-form-logic') || $element.closest('form,div.effective-datatables-filters')
66
+ else
67
+ $container = $element.closest('form,div.effective-datatables-filters')
68
+
69
+ $affects = $container.find("input[name='#{options.name}'],select[name='#{options.name}'],input[name='#{options.name}[]']")
70
+
55
71
  values = JSON.parse(options.value)
56
72
 
57
73
  $affects.on 'change', (event) ->
@@ -151,10 +151,12 @@ module Effective
151
151
  case mode
152
152
  when :default, :admin
153
153
  default_mode.merge(active_storage: active_storage, css: css, custom: { css: custom_css })
154
+ when :email
155
+ restricted_mode.merge(active_storage: false, css: css, custom: { css: custom_css })
154
156
  when :restricted
155
157
  restricted_mode.merge(active_storage: false, css: css, custom: { css: custom_css })
156
158
  else
157
- raise("unexpected mode: #{mode}. Try :default or :restricted")
159
+ raise("unexpected mode: #{mode}. Try :default, :email, or :restricted")
158
160
  end
159
161
  end
160
162
 
@@ -17,7 +17,7 @@ module Effective
17
17
  end
18
18
 
19
19
  def options
20
- { style: ('display: none;' if hide?) }
20
+ { style: ('display: none;' if hide?), class: 'effective-form-logic' }
21
21
  end
22
22
 
23
23
  def logic_options
@@ -17,7 +17,7 @@ module Effective
17
17
  end
18
18
 
19
19
  def options
20
- { style: ('display: none;' unless show?) }
20
+ { style: ('display: none;' unless show?), class: 'effective-form-logic' }
21
21
  end
22
22
 
23
23
  def logic_options
@@ -17,7 +17,7 @@ module Effective
17
17
  end
18
18
 
19
19
  def options
20
- { style: ('display: none;' unless show?) }
20
+ { style: ('display: none;' unless show?), class: 'effective-form-logic' }
21
21
  end
22
22
 
23
23
  def logic_options
@@ -1,3 +1,3 @@
1
1
  module EffectiveBootstrap
2
- VERSION = '1.18.5'.freeze
2
+ VERSION = '1.18.7'.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: 1.18.5
4
+ version: 1.18.7
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: 2024-05-10 00:00:00.000000000 Z
11
+ date: 2024-06-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails