effective_bootstrap 0.3.8 → 0.3.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
  SHA1:
3
- metadata.gz: dcb194f0ad7472f5bc556fd0f10095988d1d6ab5
4
- data.tar.gz: cdf6ac07e6ce4eeb1801ebe45c00b120af56aed3
3
+ metadata.gz: 6443858776f6375775b1dbde639ab45d9cb53cdf
4
+ data.tar.gz: 2ece4b12013167358126fb7b4338600c0d70c813
5
5
  SHA512:
6
- metadata.gz: cd90c5c8ab62050127e08844afd9ef1fa436391e6c53057faa56c38a41ffef3f57de4b8f8f6acad048d3744ec6f1ffb1bc153309d2e0c7a898347af4bc722c6c
7
- data.tar.gz: e12578590249cbb944194d159290d30874e165cb3894f06ce013798809d62c1fc7ed2256acb4a0e30e158e7168fa9c2e6dc98e598fa98f5b7cf7e73def0ebf7e
6
+ metadata.gz: 612681cb5bee5f316d7dd77098b7ea8e547beb5f11a0d0b4d0cb23dbb61a529759dc59b9b441f903d9db1c2037f23cda0cf35772a1076a4c44fc9bacf620a06f
7
+ data.tar.gz: 3c9c1ce8befeffd28bc6572a59806fee09522b4a5cfab33c7b444a8d542fe71e1409dbed48e82def9b0fd3cfc6abbd2f3c20aa6e37194670c67843ef8797a149
@@ -45,6 +45,7 @@ this.EffectiveForm ||= new class
45
45
  $form.find('.is-valid').removeClass('is-valid')
46
46
 
47
47
  $form.find('[type=submit]').removeAttr('disabled')
48
+ $form
48
49
 
49
50
  spin: -> @current_submit.addClass('form-current-submit') if @current_submit.length > 0
50
51
 
@@ -68,20 +69,22 @@ this.EffectiveForm ||= new class
68
69
  $form = $payload.find("form[data-remote-index='#{$target.data('remote-index')}']")
69
70
  $form = $payload.find('form').first() if $form.length == 0
70
71
  $form.attr('data-remote', true)
71
-
72
- return if $form.length == 0
73
-
74
- EffectiveBootstrap.initialize($form)
75
- $target.replaceWith($form)
76
- @remote_form_payload = ''
72
+ @remote_form_payload = ''
77
73
 
78
74
  # There's nothing to update if it was a successful delete
79
75
  return if was_delete
80
76
 
81
- # We update the current submit to point to the new one.
77
+ # Process remote form
78
+ if $form.length > 0
79
+ EffectiveBootstrap.initialize($form)
80
+ $target.replaceWith($form)
81
+ else
82
+ $form = @reset($target) # There is no remote form. So we assume success and reset the submitted one.
83
+
82
84
  if @current_submit.length > 0
83
85
  @current_submit = $form.find("##{@current_submit.attr('id')}.form-actions")
84
86
 
87
+ # Process Flash
85
88
  if @remote_form_flash.length > 0
86
89
  @flash($form, flash[0], flash[1], true) for flash in @remote_form_flash
87
90
  @remote_form_flash = ''
@@ -116,7 +119,11 @@ this.EffectiveForm ||= new class
116
119
  </div>
117
120
  ")
118
121
 
119
- setCurrentSubmit: ($submit) -> @current_submit = $submit if $submit.is('.form-actions')
122
+ setCurrentSubmit: ($submit) ->
123
+ if $submit.is('.form-actions')
124
+ @current_submit = $submit
125
+ else
126
+ @current_submit = ''
120
127
 
121
128
  setCurrentDelete: ($delete) -> @current_delete = $delete
122
129
 
@@ -1,3 +1,3 @@
1
1
  module EffectiveBootstrap
2
- VERSION = '0.3.8'.freeze
2
+ VERSION = '0.3.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.3.8
4
+ version: 0.3.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: 2019-01-09 00:00:00.000000000 Z
11
+ date: 2019-01-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails