effective_bootstrap 0.5.2 → 0.5.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 414f98769a02f734a5fadf2836a52d68c2c65484
4
- data.tar.gz: 28d606b988da8a8ce4446fc95ba51cb203502125
3
+ metadata.gz: 386c2ba1dfd4aee2162688fd16b987a983f5df44
4
+ data.tar.gz: a659c7b4cf707a1f299f18f82b3fc5e56354a998
5
5
  SHA512:
6
- metadata.gz: 9ae3da9c073dac7889c66ecbfd376a35489aab1b0ffafa870ef7c8af5c5794b06d77ea4c00c680cf3ff4020d7057adbd28bee630c83b62454fdec5d29c5a4a31
7
- data.tar.gz: e530b5b21de9ef12feaf392165fe2bfaea69568b31e0d02a0e90575e07b4963deacc006ecc338aa7c600a652e40a1e4630e65c505bc03c4e39d13a958248c7d0
6
+ metadata.gz: 694539152c7dbf0b449ce3e0c193c4baa41ded5302fda0f32dd4f711474c7ec57e9ba0534a1bc68fbef52a4df8fd12191a64ead6791f3f3e6fc9ce761b12ce1f
7
+ data.tar.gz: 78c5e80b4740406b26d0ea483c89c1b53dda44c27f72dec9a60db70bdbaa93c42807b6fcc7b6307a93192078129464a00cd5fcd87d631e19c7e4c6725cb0f989
@@ -20,6 +20,9 @@ this.EffectiveForm ||= new class
20
20
  @spin()
21
21
  setTimeout((-> EffectiveForm.disable($form)), 0)
22
22
 
23
+ if ($form.attr('method') || '').toLowerCase() == 'get' || (@current_submit.length > 0 && @current_submit.hasClass('form-actions-reset'))
24
+ setTimeout((-> EffectiveForm.reset($form)), 2500)
25
+
23
26
  invalidate: ($form) ->
24
27
  $form.addClass('was-validated').addClass('form-is-invalid')
25
28
  $form.find('.form-current-submit').removeClass('form-current-submit')
@@ -144,13 +147,7 @@ this.EffectiveForm ||= new class
144
147
  # Sets EffectiveBootstrap. current_click.
145
148
  # This displays the spinner here, and directs any flash messages before and after loadRemoteForm
146
149
  $(document).on 'click', '.form-actions a[data-remote],.form-actions button[type=submit]', (event) ->
147
- $submits = $(@).parent()
148
- $form = $submits.closest('form')
149
-
150
- if $submits.hasClass('form-actions-reset') || ($form.attr('method') || '').toLowerCase() == 'get'
151
- setTimeout((-> EffectiveForm.reset($form)), 2500)
152
-
153
- EffectiveForm.setCurrentSubmit($submits)
150
+ EffectiveForm.setCurrentSubmit($(@).parent())
154
151
  EffectiveForm.spin()
155
152
 
156
153
  # This actually attached the handlers to a remote ajax form when it or an action inside it triggers a remote thing.
@@ -44,18 +44,18 @@ module Effective
44
44
  if buttons? || cards?
45
45
  { class: "form-group #{tag_id}" }
46
46
  else
47
- { class: "form-group effective-radios #{tag_id}" }
47
+ { class: "form-group #{tag_id} #{button_group_class}" }
48
48
  end
49
49
  end
50
50
 
51
51
  def button_group_class
52
52
  [
53
53
  'effective-radios',
54
- ('no-feedback' if options[:feedback] == false),
55
54
  ('btn-group btn-group-toggle' if buttons?),
56
55
  ('card-deck' if cards?),
57
- ('is-invalid' if options[:feedback] && has_error?(name)),
58
- ('is-valid' if options[:feedback] && has_error? && !has_error?(name))
56
+ ('no-feedback' unless feedback_options),
57
+ ('is-invalid' if feedback_options && has_error?(name)),
58
+ ('is-valid' if feedback_options && has_error? && !has_error?(name))
59
59
  ].compact.join(' ')
60
60
  end
61
61
 
@@ -1,3 +1,3 @@
1
1
  module EffectiveBootstrap
2
- VERSION = '0.5.2'.freeze
2
+ VERSION = '0.5.3'.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.5.2
4
+ version: 0.5.3
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: 2019-04-24 00:00:00.000000000 Z
11
+ date: 2019-04-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails