effective_datatables 4.3.12 → 4.3.13
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/flash.js.coffee +1 -1
- data/app/assets/javascripts/effective_datatables/inline_crud.js.coffee +11 -2
- data/app/assets/stylesheets/effective_datatables/_overrides.scss +17 -5
- data/app/models/effective/effective_datatable/dsl/datatable.rb +2 -1
- data/app/views/effective/datatables/_bulk_actions_column.html.haml +1 -1
- data/lib/effective_datatables/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: becca55d8f11979e333f3f0a40e587d79e2280d7
|
4
|
+
data.tar.gz: ad7d4200759f221445c283c4b0afdca9166165bf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e48ceae89e86dbb2fdf796c8547d4f650590e038be2ff868e853fb77227cafb728cec96ac125d90bd83b249a59dbafe4d05165399181b025f96b8443aa643d59
|
7
|
+
data.tar.gz: 5d7fb0d3447389f5d489eadea1ff51d8e838863669db23e5e595f07e406e8dce8a6154914ac09f48ad40983c8fd37a7add11473d7eb86d82d9ec944e65fdfd18
|
@@ -17,7 +17,7 @@ flash = (message, status = '') ->
|
|
17
17
|
timeout = $processing.data('timeout')
|
18
18
|
clearTimeout(timeout) if timeout
|
19
19
|
|
20
|
-
delay = (if status == 'danger' then 4000 else
|
20
|
+
delay = (if status == 'danger' then 4000 else 1500)
|
21
21
|
|
22
22
|
$processing.html(message).data('timeout', setTimeout( =>
|
23
23
|
$processing.html('Processing...').hide()
|
@@ -1,7 +1,7 @@
|
|
1
1
|
# To achieve inline crud, we use rails' data-remote links, and override their behaviour when inside a datatable
|
2
2
|
# This works with EffectiveForm.remote_form which is part of the effective_bootstrap gem.
|
3
3
|
|
4
|
-
#
|
4
|
+
# We click the New/Edit/Action button from the col-actions
|
5
5
|
$(document).on 'ajax:beforeSend', '.dataTables_wrapper .col-actions', (e, xhr, settings) ->
|
6
6
|
$action = $(e.target)
|
7
7
|
$table = $(e.target).closest('table')
|
@@ -12,7 +12,7 @@ $(document).on 'ajax:beforeSend', '.dataTables_wrapper .col-actions', (e, xhr, s
|
|
12
12
|
settings.url += (if settings.url.indexOf('?') == -1 then '?' else '&') + $params
|
13
13
|
|
14
14
|
if $action.closest('.effective-datatables-inline-row').length > 0
|
15
|
-
# Nothing.
|
15
|
+
# Nothing.
|
16
16
|
else if $action.closest('tr').parent().prop('tagName') == 'THEAD'
|
17
17
|
beforeNew($action)
|
18
18
|
else
|
@@ -45,6 +45,15 @@ $(document).on 'ajax:error', '.dataTables_wrapper', (event) ->
|
|
45
45
|
EffectiveForm.remote_form_flash = ''
|
46
46
|
true
|
47
47
|
|
48
|
+
# Submitting an inline datatables form
|
49
|
+
$(document).on 'ajax:beforeSend', '.dataTables_wrapper .col-inline-form', (e, xhr, settings) ->
|
50
|
+
$table = $(e.target).closest('table')
|
51
|
+
|
52
|
+
$params = $.param({_datatable_id: $table.attr('id'), _datatable_cookie: $table.data('cookie') })
|
53
|
+
settings.url += (if settings.url.indexOf('?') == -1 then '?' else '&') + $params
|
54
|
+
|
55
|
+
true
|
56
|
+
|
48
57
|
# The inline form has been submitted successfully
|
49
58
|
$(document).on 'effective-form:success', '.dataTables_wrapper .col-inline-form', (event, flash) ->
|
50
59
|
$action = $(event.target)
|
@@ -128,16 +128,28 @@ table.dataTable.collapsed {
|
|
128
128
|
|
129
129
|
// Processing div
|
130
130
|
div.dataTables_wrapper div.dataTables_processing {
|
131
|
+
margin: -26px 25% 0px 25%;
|
132
|
+
|
131
133
|
position: absolute;
|
132
|
-
top:
|
133
|
-
left:
|
134
|
-
width:
|
135
|
-
margin-left: -150px;
|
136
|
-
margin-top: -26px;
|
134
|
+
top: 0;
|
135
|
+
left: 0;
|
136
|
+
width: 50%;
|
137
137
|
text-align: center;
|
138
138
|
padding: 1em;
|
139
139
|
}
|
140
140
|
|
141
|
+
// Processing success
|
142
|
+
div.dataTables_wrapper div.dataTables_processing.alert-success {
|
143
|
+
margin: -26px 10% 0px 10%;
|
144
|
+
width: 80%;
|
145
|
+
}
|
146
|
+
|
147
|
+
// Processing error
|
148
|
+
div.dataTables_wrapper div.dataTables_processing.alert-danger {
|
149
|
+
margin: -26px 10% 0px 10%;
|
150
|
+
width: 80%;
|
151
|
+
}
|
152
|
+
|
141
153
|
// Simple styles
|
142
154
|
table.dataTable.hide-sort > thead {
|
143
155
|
.sorting { background-image: none; cursor: default; }
|
@@ -122,7 +122,7 @@ module Effective
|
|
122
122
|
|
123
123
|
# Called automatically after bulk_actions do ... end
|
124
124
|
# Call again if you want to change the position of the bulk_actions_col
|
125
|
-
def bulk_actions_col(col_class: nil, partial: nil, partial_as: nil, responsive: 5000)
|
125
|
+
def bulk_actions_col(col_class: nil, input_name: nil, partial: nil, partial_as: nil, responsive: 5000)
|
126
126
|
datatable._columns.delete(:_bulk_actions) if datatable.columns[:_bulk_actions]
|
127
127
|
|
128
128
|
datatable._columns[:_bulk_actions] = Effective::DatatableColumn.new(
|
@@ -132,6 +132,7 @@ module Effective
|
|
132
132
|
col_class: col_class,
|
133
133
|
format: nil,
|
134
134
|
index: nil,
|
135
|
+
input_name: (input_name || 'bulk_actions_resources'),
|
135
136
|
label: false,
|
136
137
|
name: :bulk_actions,
|
137
138
|
partial: partial || '/effective/datatables/bulk_actions_column',
|
@@ -2,5 +2,5 @@
|
|
2
2
|
|
3
3
|
.form-group.custom-control.custom-checkbox
|
4
4
|
%input{value: 0, type: 'hidden'}
|
5
|
-
%input.custom-control-input{name:
|
5
|
+
%input.custom-control-input{name: "#{column[:input_name]}[]", id: "datatable_bulk_actions_resource_#{id}", value: id, type: 'checkbox', autocomplete: 'off', 'data-role': 'bulk-action' }
|
6
6
|
%label.custom-control-label{for: "datatable_bulk_actions_resource_#{id}" }
|