effective_datatables 4.3.17 → 4.3.18
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: b0f1f7129ba1f68f7eca787f98a1dea4475dc379
|
4
|
+
data.tar.gz: 14044e64fd3af2005024e36bdd64f55c6acc3941
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7083b5a8b35f60f301f92b7ba321e4a9af161f446bad469b1db89b881cc226be9669dae49dd34eb210bde0a8e20860557b2169f08aa469943edec5a62c79b3df
|
7
|
+
data.tar.gz: 871db6690295c93e1299ec40ea57776d1f01fe7df0fede78de2ae70a0296c0db396bc088b0ba110caca683c9f78b8bef8b45ec6623d4d5dfb4d132b388f5a895
|
@@ -33,6 +33,7 @@ $(document).on 'ajax:success', '.dataTables_wrapper .col-actions', (event) ->
|
|
33
33
|
|
34
34
|
EffectiveForm.remote_form_payload = ''
|
35
35
|
EffectiveForm.remote_form_flash = ''
|
36
|
+
EffectiveForm.remote_form_refresh_datatables = ''
|
36
37
|
true
|
37
38
|
|
38
39
|
# There was an error completing something
|
@@ -43,6 +44,7 @@ $(document).on 'ajax:error', '.dataTables_wrapper', (event) ->
|
|
43
44
|
|
44
45
|
EffectiveForm.remote_form_payload = ''
|
45
46
|
EffectiveForm.remote_form_flash = ''
|
47
|
+
EffectiveForm.remote_form_refresh_datatables = ''
|
46
48
|
true
|
47
49
|
|
48
50
|
# Submitting an inline datatables form
|
@@ -72,6 +74,8 @@ $(document).on 'effective-form:success', '.dataTables_wrapper .col-inline-form',
|
|
72
74
|
$table.DataTable().flash(flash || 'Item updated', 'success').draw()
|
73
75
|
$tr.fadeOut('slow')
|
74
76
|
|
77
|
+
refreshDatatables($table)
|
78
|
+
|
75
79
|
beforeNew = ($action) ->
|
76
80
|
$table = $action.closest('table')
|
77
81
|
$th = $action.closest('th')
|
@@ -135,6 +139,8 @@ afterAction = ($action) ->
|
|
135
139
|
else
|
136
140
|
$table.DataTable().flash('Successfully ' + $action.attr('title'), 'success').draw()
|
137
141
|
|
142
|
+
refreshDatatables($table)
|
143
|
+
|
138
144
|
buildRow = (length, payload) ->
|
139
145
|
"<td class='col-inline-form' colspan='#{length-1}'><div class='container'>#{payload}</div></td>" +
|
140
146
|
"<td class='col-actions col-actions-inline-form'>" +
|
@@ -149,6 +155,17 @@ cancel = ($table) ->
|
|
149
155
|
$wrapper = $table.closest('.dataTables_wrapper')
|
150
156
|
$wrapper.removeClass('effective-datatables-inline-expanded') if $wrapper.find('.effective-datatables-inline-row').length == 0
|
151
157
|
|
158
|
+
refreshDatatables = ($source) ->
|
159
|
+
return unless EffectiveForm.remote_form_refresh_datatables.length > 0
|
160
|
+
|
161
|
+
$('table.dataTable.initialized').each ->
|
162
|
+
$table = $(this)
|
163
|
+
|
164
|
+
if EffectiveForm.remote_form_refresh_datatables.find((id) -> $table.attr('id').startsWith(id) || id == 'all') && $table != $except
|
165
|
+
if $table != $source
|
166
|
+
console.log("Refreshing #{$table}")
|
167
|
+
$table.DataTable().draw()
|
168
|
+
|
152
169
|
# Cancel button clicked. Blow away new tr, or restore edit tr
|
153
170
|
# No data will have changed at this point
|
154
171
|
$(document).on 'click', ".dataTables_wrapper a[data-role='inline-form-cancel']", (event) ->
|
@@ -182,5 +199,3 @@ $(document).on 'click', ".dataTables_wrapper a[data-role='inline-form-cancel']",
|
|
182
199
|
)
|
183
200
|
|
184
201
|
false
|
185
|
-
|
186
|
-
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: effective_datatables
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.3.
|
4
|
+
version: 4.3.18
|
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-12-
|
11
|
+
date: 2018-12-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|