effective_bootstrap 0.5.8 → 0.5.9
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e56cb0d66bf343fd5e5cb653cde7790a06ffca51
|
4
|
+
data.tar.gz: a6c04cc35382f917a3f692a5af8253306bd26a54
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
104
|
-
|
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))
|