effective_bootstrap 0.5.8 → 0.5.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: 924e625edc3abab84f5eba1a7ddd7c7c8259e8e4
4
- data.tar.gz: 36ecf566fcdc57afc35cdaa964a4c8eea1992f1f
3
+ metadata.gz: e56cb0d66bf343fd5e5cb653cde7790a06ffca51
4
+ data.tar.gz: a6c04cc35382f917a3f692a5af8253306bd26a54
5
5
  SHA512:
6
- metadata.gz: 2fd766f9e8a968291b5b51fb7d7c753f25f82c7943bf683963a211bc04acd0bfa6b90c19c96c47b7aa9c962536f9d060f5b22e5c2bbf78c48abf49a482df71f8
7
- data.tar.gz: 08e70de9e27710de91e86e7719d722814c270dd8f3fd2e9bde86e8480fb540b0aefafc01f94e1a803caa0b43e5f3082c447fa68aa2523a5a9aa7872ab1ef5d2b
6
+ metadata.gz: 4be0e66d4f8c1320e6313ec890521b6b278b2ca75cb3c5bbc3103519fed5ee4f540f016188c0826790dba40298dee1c57028b9f56dfa5446d575aff4e2eb88f0
7
+ data.tar.gz: 60010b7e9646ec228cd1256462a1608476ab6b4f9c4f8051afb4eaca2712ad3461ad8904dc2600f9c1da7eedcadf0a4afe82836dd679b77774b6a9465296b216
@@ -1,6 +1,7 @@
1
1
  this.EffectiveForm ||= new class
2
2
  current_submit: '' # The $(.form-actions) that clicked
3
3
  current_delete: '' # If there's a rails ujs_delete link with the data-closeset selector, use this.
4
+ remote_form_commit: '' # String containing the last params[:commit]
4
5
  remote_form_payload: '' # String containing html from server side render of this form
5
6
  remote_form_flash: '' # Array of Arrays
6
7
  remote_form_refresh_datatables: '' # Array of Strings. effective_datatables inline_crud.js uses this
@@ -100,19 +101,25 @@ this.EffectiveForm ||= new class
100
101
  # Fire off form events
101
102
  was_error = ($form.hasClass('with-errors') || flash_status == 'danger' || flash_status == 'error')
102
103
 
103
- $form.trigger((if was_error then 'effective-form:error' else 'effective-form:success'), flash_message)
104
- $form.trigger('effective-form:complete', flash_message, was_error)
104
+ if was_error
105
+ $form.trigger('effective-form:error', [flash_message, @remote_form_commit])
106
+ else
107
+ $form.trigger('effective-form:success', [flash_message, @remote_form_commit])
108
+
109
+ $form.trigger('effective-form:complete', @remote_form_commit, [flash_message, @remote_form_commit, was_error])
105
110
 
106
111
  @remote_form_flash = ''
112
+ @remote_form_commit = ''
113
+ @current_submit = ''
107
114
  true
108
115
 
109
116
  flash: ($form, status, message, skip_success = false) ->
110
117
  return unless @current_submit.length > 0
111
118
 
112
119
  if status == 'danger' || status == 'error'
113
- @current_submit.find('.eb-icon-x').show().delay(1000).fadeOut('slow', -> $form.trigger('effective-form:error-animation-done', message))
120
+ @current_submit.find('.eb-icon-x').show().delay(1000).fadeOut('slow', -> $form.trigger('effective-form:error-animation-done', @remote_form_commit, message))
114
121
  else
115
- @current_submit.find('.eb-icon-check').show().delay(1000).fadeOut('slow', -> $form.trigger('effective-form:success-animation-done', message))
122
+ @current_submit.find('.eb-icon-check').show().delay(1000).fadeOut('slow', -> $form.trigger('effective-form:success-animation-done', @remote_form_commit, message))
116
123
 
117
124
  if message? && !(status == 'success' && skip_success)
118
125
  @current_submit.prepend(@buildFlash(status, message))
@@ -1,3 +1,3 @@
1
1
  module EffectiveBootstrap
2
- VERSION = '0.5.8'.freeze
2
+ VERSION = '0.5.9'.freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: effective_bootstrap
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.8
4
+ version: 0.5.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Code and Effect