effective_bootstrap 0.0.28 → 0.0.29

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: c86bfcfaf09f0b377e597a73666b33345fe4cbfb
4
- data.tar.gz: 903be952705a11736f591a3cf7dacf78ed9a3979
3
+ metadata.gz: c5b5ab69922453107c33ee2e23222f74fb5ad91a
4
+ data.tar.gz: 9c372c210a203b2c47473f78d01b91852f4ab243
5
5
  SHA512:
6
- metadata.gz: ba71de31350daf7d706034f2bf39837b893446573ab616be7ae962ef7e798901eeb0a72826da659dfc9e4bf79cacfa7a85557f05f24f184eaf22ff2ff9785efb
7
- data.tar.gz: 4983d532de3560846fdb43667bf845feb0ec2aff2805e2cd384eb1734e6c100696cded837d112402172bee362d4eef1f6fdacaa9a2e56c80435d77345ccacc93
6
+ metadata.gz: c78fd7b598bd7a5f67167aabe94ba789ee12d060bf273199380ce35fbf28bc50bf93a7ce9487d786a9e2ad954b9715f914704285058ec709373e3df2b63296de
7
+ data.tar.gz: e024f7950477fcc310626f3cf783d294394f0fd75148ee66f48bfdb47fb5c0eb71aff54abbcfeaa1834ce3e674f6ebf2d71fae4492c53f6c79e3c75e1017e006
@@ -1,5 +1,6 @@
1
1
  this.EffectiveForm ||= new class
2
2
  current_submit: '' # The $(.form-actions) that clicked
3
+ current_delete: '' # If there's a rails ujs_delete link with the data-closeset selector, use this.
3
4
  remote_form_payload: '' # String containing html from server side render of this form
4
5
  remote_form_flash: '' # Array of Arrays
5
6
 
@@ -108,6 +109,13 @@ this.EffectiveForm ||= new class
108
109
 
109
110
  setCurrentSubmit: ($submit) -> @current_submit = $submit if $submit.is('.form-actions')
110
111
 
112
+ setCurrentDelete: ($delete) -> @current_delete = $delete
113
+
114
+ finishDelete: ->
115
+ if @current_delete.length > 0
116
+ @current_delete.fadeOut('slow', -> $(this).remove())
117
+ @current_delete = ''
118
+
111
119
  # Sets EffectiveBootstrap. current_click.
112
120
  # This displays the spinner here, and directs any flash messages before and after loadRemoteForm
113
121
  $(document).on 'click', '.form-actions a[data-remote],.form-actions button[type=submit]', (event) ->
@@ -118,3 +126,7 @@ $(document).on 'click', '.form-actions a[data-remote],.form-actions button[type=
118
126
  $(document).on 'ajax:beforeSend', 'form[data-remote]', (event) ->
119
127
  EffectiveForm.beforeAjax($(@))
120
128
  this.checkValidity()
129
+
130
+ $(document).on 'ajax:beforeSend', '[data-method=delete]', (event) ->
131
+ if ($delete = $(@)).data('closest')
132
+ EffectiveForm.setCurrentDelete($delete.closest($delete.data('closest')))
@@ -1,3 +1,3 @@
1
1
  module EffectiveBootstrap
2
- VERSION = '0.0.28'.freeze
2
+ VERSION = '0.0.29'.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.0.28
4
+ version: 0.0.29
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: 2018-06-26 00:00:00.000000000 Z
11
+ date: 2018-06-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails