effective_bootstrap 0.9.21 → 0.9.22

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
  SHA256:
3
- metadata.gz: d047c5108e24b36af0b9269cea370b61afaae229174b8b3febf59c95fdca14f7
4
- data.tar.gz: 75f25ac6d8dc18e6f4b4462a6eb16b237c4aa6898d19c2686348241b8337da0d
3
+ metadata.gz: dc2972eec59594f06ea675c943277a99d67ca6e1e75e30e10bcc7252c776a15d
4
+ data.tar.gz: 22debca767e9449ba70d890bd98d38e262641d39fcc6b7c53fd184f28a9d83ae
5
5
  SHA512:
6
- metadata.gz: '09531a9a125e7d7aebec11aa7fe41ef563ccc5f1777dc04cb02603ec8edb0d3384ba86d5f3c79aefe5d64b45a72dd4ded0c098fe6593c4347f080c8faaca237f'
7
- data.tar.gz: 349e700ff1f0324dd51f81ecb134774720f0de7197d0c1da4684388a67314828c4a211e903a26b279e8adb25b451629632123ac12204a51380738c7f0dac7a67
6
+ metadata.gz: f14eceace3be9ceead1d2fdec73c34959223e3a47684355da505d41165e4d68b3c24203c95d1b5009b58153725052f5c91398c6c6affd499ba3ca00ca35fd7df
7
+ data.tar.gz: 7a847310a0b44fae9ce81e7fb21f5cf89bfc43c2200bfafea61eddc6341adf32e1cb2b3d8e896d6add4c52a663b2d399e261b4e2a6b9d62897ffb17db1bc8802
@@ -4,6 +4,7 @@ this.EffectiveForm ||= new class
4
4
  remote_form_commit: '' # String containing the last params[:commit]
5
5
  remote_form_payload: '' # String containing html from server side render of this form
6
6
  remote_form_flash: '' # Array of Arrays
7
+ remote_form_redirect: '' # String containing the redirect path (optional)
7
8
 
8
9
  validate: (form) ->
9
10
  valid = form.checkValidity()
@@ -73,6 +74,15 @@ this.EffectiveForm ||= new class
73
74
  $target = $target.closest('form') unless $target.is('form')
74
75
  $form = ''
75
76
 
77
+ if @remote_form_redirect.length > 0
78
+ if window.Turbolinks
79
+ window.Turbolinks.visit(@remote_form_redirect)
80
+ else
81
+ window.location.href = @remote_form_redirect
82
+
83
+ @remote_form_redirect = ''
84
+ return
85
+
76
86
  if @remote_form_payload.length > 0
77
87
  $payload = $("<div>#{@remote_form_payload}</div>")
78
88
  $form = $payload.find("form[data-remote-index='#{$target.data('remote-index')}']")
@@ -160,7 +170,7 @@ this.EffectiveForm ||= new class
160
170
  # This displays the spinner here, and directs any flash messages before and after loadRemoteForm
161
171
  $(document).on 'click', '.form-actions a[data-remote],.form-actions button[type=submit]', (event) ->
162
172
  EffectiveForm.setCurrentSubmit($(@).parent())
163
- EffectiveForm.spin()
173
+ EffectiveForm.spin() unless $(@).attr('data-confirm')
164
174
 
165
175
  # This actually attached the handlers to a remote ajax form when it or an action inside it triggers a remote thing.
166
176
  $(document).on 'ajax:beforeSend', 'form[data-remote]', (event) ->
@@ -1,3 +1,3 @@
1
1
  module EffectiveBootstrap
2
- VERSION = '0.9.21'.freeze
2
+ VERSION = '0.9.22'.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.9.21
4
+ version: 0.9.22
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: 2021-04-06 00:00:00.000000000 Z
11
+ date: 2021-04-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails