effective_datatables 4.4.0 → 4.4.1

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: 828cb1049a01b368938b83f52d19c30f7862a107
4
- data.tar.gz: e28a0587e498c6e5043ce7d365f5287583fde071
3
+ metadata.gz: 7efc5c4ebe5adbadcf46a1368c3034601e32ba38
4
+ data.tar.gz: c167f47e82261487b9fa1574c75dc116216314c5
5
5
  SHA512:
6
- metadata.gz: 6f9b9f6863b9d137c69ac75768ac8fe59fa8c749013aec3a8bb930935c601fc77ec1992f6a27f98706bb60e7d26d8bf1f18101a8d5ec1a67ff5b524ae03b4db5
7
- data.tar.gz: e9432d48db55a39572baf6e02e23e9685d8b357bd49db7a29ab56821b0dc52078b8405d5b170c1fe083c4c77a97fa4226aac02729f4611b9e8a4fcc248a7d24b
6
+ metadata.gz: 6aaa13c5b1b4e90d3b3c7d00090c44482753541a0fdd8feb02bab110223e6e7222bab2bef886900f5fa222292f6ec767634e87d94b0ac37855f60b3f765293ee
7
+ data.tar.gz: 6f1dcd266204fca3f546c5dfcbf43e56e3ece6f089dc8efa8ae12b63e237951d0d3cd1dd1ea162818b43499b834b8b059343c38087a456a86e106bb42c66f0ef
@@ -39,8 +39,10 @@ $(document).on 'ajax:success', '.dataTables_wrapper .col-actions', (event) ->
39
39
  # There was an error completing something
40
40
  $(document).on 'ajax:error', '.dataTables_wrapper', (event) ->
41
41
  $action = $(event.target)
42
- $table = $action.closest('table')
43
- $table.DataTable().flash('unable to ' + ($action.attr('title') || 'complete action'), 'danger').draw()
42
+
43
+ return true if ('' + $action.data('inline')) == 'false'
44
+
45
+ afterError($action)
44
46
 
45
47
  EffectiveForm.remote_form_payload = ''
46
48
  EffectiveForm.remote_form_flash = ''
@@ -146,6 +148,22 @@ afterAction = ($action) ->
146
148
  $table.DataTable().draw()
147
149
  refreshDatatables($table)
148
150
 
151
+ afterError = ($action) ->
152
+ $table = $action.closest('table')
153
+ $td = $action.closest('td')
154
+
155
+ # Show dropdown
156
+ $td.children('.btn-group').show()
157
+
158
+ # Hide spinner
159
+ $td.children('svg').hide()
160
+
161
+ # Cancel
162
+ cancel($table)
163
+
164
+ # Don't redraw
165
+ $table.DataTable().flash('unable to ' + ($action.attr('title') || 'complete action'), 'danger')
166
+
149
167
  buildRow = (length, payload) ->
150
168
  "<td class='col-inline-form' colspan='#{length-1}'><div class='container'>#{payload}</div></td>" +
151
169
  "<td class='col-actions col-actions-inline-form'>" +
@@ -1,3 +1,3 @@
1
1
  module EffectiveDatatables
2
- VERSION = '4.4.0'.freeze
2
+ VERSION = '4.4.1'.freeze
3
3
  end
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.4.0
4
+ version: 4.4.1
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: 2019-03-15 00:00:00.000000000 Z
11
+ date: 2019-03-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails