effective_datatables 4.3.11 → 4.3.12
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/javascripts/effective_datatables/bulk_actions.js.coffee +4 -4
- data/app/assets/javascripts/effective_datatables/flash.js.coffee +12 -2
- data/app/assets/javascripts/effective_datatables/inline_crud.js.coffee +5 -7
- data/app/assets/javascripts/effective_datatables/reorder.js.coffee +1 -1
- data/lib/effective_datatables/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 29a6e0d0478885ad23309fecf7867b03dca64adf
|
4
|
+
data.tar.gz: 0b61e07209624deada4c8d3eaf250582cbb2c2b4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 487154867732b2b954e9f1966246b6d9e32d919cc885ec8f98771bf020f58a1c8ed85177214442187357b1b464fa8063affffe6b9ba2f18a983e9d54022d98b3
|
7
|
+
data.tar.gz: 5fba36836e3c439dfa736e67fa9bb84ef4ef50c4b46880d9431effb321f1d7c9cb1052338e56b139926aa7558fe7b62ede4e2fc52f62def9f5e4b7a9e4dbbbf1
|
@@ -78,11 +78,11 @@ $(document).on 'click', '.dataTables_wrapper .buttons-bulk-actions a', (event) -
|
|
78
78
|
data: { ids: values, authenticity_token: token }
|
79
79
|
successCallback: ->
|
80
80
|
success = "Successfully completed #{title} bulk action"
|
81
|
-
$table.one 'draw.dt', (e) -> $(e.target).DataTable().flash(success)
|
81
|
+
$table.one 'draw.dt', (e) -> $(e.target).DataTable().flash(success, 'success')
|
82
82
|
$table.DataTable().draw()
|
83
83
|
failCallback: ->
|
84
84
|
error = "An error occured while attempting #{title} bulk action"
|
85
|
-
$table.one 'draw.dt', (e) -> $(e.target).DataTable().flash(error)
|
85
|
+
$table.one 'draw.dt', (e) -> $(e.target).DataTable().flash(error, 'danger')
|
86
86
|
$table.DataTable().draw()
|
87
87
|
)
|
88
88
|
else # Normal AJAX post
|
@@ -94,11 +94,11 @@ $(document).on 'click', '.dataTables_wrapper .buttons-bulk-actions a', (event) -
|
|
94
94
|
data: { ids: values }
|
95
95
|
).done((response) ->
|
96
96
|
success = response['message'] || "Successfully completed #{title} bulk action"
|
97
|
-
$table.one 'draw.dt', (e) -> $(e.target).DataTable().flash(success) and restoreSelected($(e.target), values)
|
97
|
+
$table.one 'draw.dt', (e) -> $(e.target).DataTable().flash(success, 'success') and restoreSelected($(e.target), values)
|
98
98
|
|
99
99
|
).fail((response) ->
|
100
100
|
error = response['message'] || "An error occured while attempting #{title} bulk action: #{response.statusText}"
|
101
|
-
$table.one 'draw.dt', (e) -> $(e.target).DataTable().flash(error) and restoreSelected($(e.target), values)
|
101
|
+
$table.one 'draw.dt', (e) -> $(e.target).DataTable().flash(error, 'danger') and restoreSelected($(e.target), values)
|
102
102
|
|
103
103
|
).always((response) ->
|
104
104
|
$table.DataTable().draw()
|
@@ -1,18 +1,28 @@
|
|
1
|
-
flash = (message) ->
|
1
|
+
flash = (message, status = '') ->
|
2
2
|
@context[0].oFeatures.bProcessing = false
|
3
3
|
|
4
4
|
message ||= 'Processing...'
|
5
5
|
|
6
|
+
if status == 'danger'
|
7
|
+
message = 'Error: ' + message
|
8
|
+
|
6
9
|
$processing = $(@table().node()).siblings('.dataTables_processing')
|
10
|
+
$processing.removeClass('alert-success alert-info alert-warning alert-danger alert-error')
|
11
|
+
|
12
|
+
if status.length > 0
|
13
|
+
$processing.addClass("alert-#{status}")
|
14
|
+
|
7
15
|
$processing.html(message).show()
|
8
16
|
|
9
17
|
timeout = $processing.data('timeout')
|
10
18
|
clearTimeout(timeout) if timeout
|
11
19
|
|
20
|
+
delay = (if status == 'danger' then 4000 else 1000)
|
21
|
+
|
12
22
|
$processing.html(message).data('timeout', setTimeout( =>
|
13
23
|
$processing.html('Processing...').hide()
|
14
24
|
@context[0].oFeatures.bProcessing = true
|
15
|
-
,
|
25
|
+
, delay)
|
16
26
|
)
|
17
27
|
|
18
28
|
return @
|
@@ -39,7 +39,7 @@ $(document).on 'ajax:success', '.dataTables_wrapper .col-actions', (event) ->
|
|
39
39
|
$(document).on 'ajax:error', '.dataTables_wrapper', (event) ->
|
40
40
|
$action = $(event.target)
|
41
41
|
$table = $action.closest('table')
|
42
|
-
$table.DataTable().flash('
|
42
|
+
$table.DataTable().flash('unable to ' + ($action.attr('title') || 'complete action'), 'danger').draw()
|
43
43
|
|
44
44
|
EffectiveForm.remote_form_payload = ''
|
45
45
|
EffectiveForm.remote_form_flash = ''
|
@@ -53,18 +53,16 @@ $(document).on 'effective-form:success', '.dataTables_wrapper .col-inline-form',
|
|
53
53
|
$table = $tr.closest('table')
|
54
54
|
|
55
55
|
if $tr.hasClass('effective-datatables-new-resource')
|
56
|
-
$table.DataTable().flash(flash || 'Item created').draw()
|
56
|
+
$table.DataTable().flash(flash || 'Item created', 'success').draw()
|
57
57
|
$tr.fadeOut('slow')
|
58
58
|
|
59
59
|
$actions = $table.children('thead').find('th.col-actions')
|
60
60
|
$actions.children('svg').remove()
|
61
61
|
$actions.children('a').fadeIn()
|
62
62
|
else
|
63
|
-
$table.DataTable().flash(flash || 'Item updated').draw()
|
63
|
+
$table.DataTable().flash(flash || 'Item updated', 'success').draw()
|
64
64
|
$tr.fadeOut('slow')
|
65
65
|
|
66
|
-
|
67
|
-
|
68
66
|
beforeNew = ($action) ->
|
69
67
|
$table = $action.closest('table')
|
70
68
|
$th = $action.closest('th')
|
@@ -124,9 +122,9 @@ afterAction = ($action) ->
|
|
124
122
|
|
125
123
|
if EffectiveForm.remote_form_flash.length > 0
|
126
124
|
flash = EffectiveForm.remote_form_flash[0]
|
127
|
-
$table.DataTable().flash(
|
125
|
+
$table.DataTable().flash(flash[1], flash[0]).draw()
|
128
126
|
else
|
129
|
-
$table.DataTable().flash('Successfully ' + $action.attr('title')).draw()
|
127
|
+
$table.DataTable().flash('Successfully ' + $action.attr('title'), 'success').draw()
|
130
128
|
|
131
129
|
buildRow = (length, payload) ->
|
132
130
|
"<td class='col-inline-form' colspan='#{length-1}'><div class='container'>#{payload}</div></td>" +
|
@@ -17,7 +17,7 @@ reorder = (event, diff, edit) ->
|
|
17
17
|
data: data,
|
18
18
|
async: false
|
19
19
|
).fail((response, text, status) =>
|
20
|
-
$(event.target).closest('table').DataTable().flash(status)
|
20
|
+
$(event.target).closest('table').DataTable().flash(status, 'danger')
|
21
21
|
).always((response) =>
|
22
22
|
@context[0].rowreorder.c.enable = true
|
23
23
|
)
|
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.12
|
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-
|
11
|
+
date: 2018-12-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|