effective_datatables 4.3.9 → 4.3.10
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 +4 -4
- data/app/assets/javascripts/effective_datatables/inline_crud.js.coffee +11 -5
- data/app/assets/javascripts/effective_datatables/reorder.js.coffee +5 -0
- data/app/assets/stylesheets/dataTables/responsive/responsive.bootstrap4.css +2 -2
- data/app/helpers/effective_datatables_private_helper.rb +5 -5
- data/app/models/effective/effective_datatable/cookie.rb +1 -1
- data/app/models/effective/effective_datatable/resource.rb +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: a2e79c3aee191317391bd99e89b942fcdbeab3d8
|
4
|
+
data.tar.gz: da4378c6d6ea2abe3b8599e6f7c265ecd3ff9740
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5578434dbcfaabd0afb207b0bc6ba1e45622da78dbe5848659367f039ddb9bb387505abbe0eeabfdc49c00d2565362d3afe532b81bf63ba856287c9f0bd206df
|
7
|
+
data.tar.gz: addf9df90187cbd2572568acbb34b0d4038075f3e894049ae2824074047a77f6da76130fe29f84e8639ee8b318da10a3b64191547566d2f5e7c62e15c21eeb5b
|
@@ -35,6 +35,16 @@ $(document).on 'ajax:success', '.dataTables_wrapper .col-actions', (event) ->
|
|
35
35
|
EffectiveForm.remote_form_flash = ''
|
36
36
|
true
|
37
37
|
|
38
|
+
# There was an error completing something
|
39
|
+
$(document).on 'ajax:error', '.dataTables_wrapper', (event) ->
|
40
|
+
$action = $(event.target)
|
41
|
+
$table = $action.closest('table')
|
42
|
+
$table.DataTable().flash('Error: unable to ' + ($action.attr('title') || 'complete action')).draw()
|
43
|
+
|
44
|
+
EffectiveForm.remote_form_payload = ''
|
45
|
+
EffectiveForm.remote_form_flash = ''
|
46
|
+
true
|
47
|
+
|
38
48
|
# The inline form has been submitted successfully
|
39
49
|
$(document).on 'effective-form:success', '.dataTables_wrapper .col-inline-form', (event, flash) ->
|
40
50
|
$action = $(event.target)
|
@@ -53,11 +63,7 @@ $(document).on 'effective-form:success', '.dataTables_wrapper .col-inline-form',
|
|
53
63
|
$table.DataTable().flash(flash || 'Item updated').draw()
|
54
64
|
$tr.fadeOut('slow')
|
55
65
|
|
56
|
-
|
57
|
-
$(document).on 'ajax:error', '.dataTables_wrapper .col-inline-form', (event) ->
|
58
|
-
$action = $(event.target)
|
59
|
-
$table = $action.closest('table')
|
60
|
-
$table.DataTable().flash('Error: unable to ' + ($action.attr('title') || 'complete action')).draw()
|
66
|
+
|
61
67
|
|
62
68
|
beforeNew = ($action) ->
|
63
69
|
$table = $action.closest('table')
|
@@ -33,5 +33,10 @@ $(document).on 'click', '.dataTables_wrapper a.buttons-reorder', (event) ->
|
|
33
33
|
column = $table.DataTable().column('.col-_reorder')
|
34
34
|
return unless column.length > 0
|
35
35
|
|
36
|
+
if column.visible()
|
37
|
+
$table.removeClass('reordering')
|
38
|
+
else
|
39
|
+
$table.addClass('reordering')
|
40
|
+
|
36
41
|
column.visible(!column.visible())
|
37
42
|
|
@@ -14,8 +14,8 @@ table.dataTable.dtr-inline.collapsed > tbody > tr[role="row"] > th:first-child {
|
|
14
14
|
padding-left: 30px;
|
15
15
|
cursor: pointer;
|
16
16
|
}
|
17
|
-
table.dataTable.dtr-inline.collapsed > tbody > tr[role="row"] > td:first-child:before,
|
18
|
-
table.dataTable.dtr-inline.collapsed > tbody > tr[role="row"] > th:first-child:before {
|
17
|
+
table.dataTable.dtr-inline.collapsed:not(.reordering) > tbody > tr[role="row"] > td:first-child:before,
|
18
|
+
table.dataTable.dtr-inline.collapsed:not(.reordering) > tbody > tr[role="row"] > th:first-child:before {
|
19
19
|
top: 12px;
|
20
20
|
left: 4px;
|
21
21
|
height: 14px;
|
@@ -34,15 +34,15 @@ module EffectiveDatatablesPrivateHelper
|
|
34
34
|
end
|
35
35
|
|
36
36
|
def datatable_reorder(datatable)
|
37
|
-
return
|
37
|
+
return unless datatable.reorder? && EffectiveDatatables.authorized?(self, :update, datatable.collection_class)
|
38
38
|
link_to(content_tag(:span, 'Reorder'), '#', class: 'btn btn-link btn-sm buttons-reorder', disabled: true)
|
39
39
|
end
|
40
40
|
|
41
41
|
def datatable_new_resource_button(datatable, name, column)
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
42
|
+
return unless column[:inline] && (column[:actions][:new] != false) && (datatable.resource.actions.include?(:new) rescue false)
|
43
|
+
|
44
|
+
actions = {'New' => { action: :new, class: ['btn', column[:btn_class].presence].compact.join(' '), 'data-remote': true } }
|
45
|
+
render_resource_actions(datatable.resource.klass, actions: actions, effective_resource: datatable.resource) # Will only work if permitted
|
46
46
|
end
|
47
47
|
|
48
48
|
def datatable_label_tag(datatable, name, opts)
|
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.10
|
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-
|
11
|
+
date: 2018-11-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|