effective_datatables 3.7.7 → 4.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/MIT-LICENSE +1 -1
- data/README.md +32 -32
- data/app/assets/images/dataTables/sort-down.svg +1 -0
- data/app/assets/images/dataTables/sort-up.svg +1 -0
- data/app/assets/images/dataTables/sort.svg +1 -0
- data/app/assets/javascripts/dataTables/buttons/{buttons.bootstrap.js → buttons.bootstrap4.js} +7 -15
- data/app/assets/javascripts/dataTables/dataTables.bootstrap4.js +184 -0
- data/app/assets/javascripts/dataTables/responsive/dataTables.responsive.js +30 -11
- data/app/assets/javascripts/dataTables/responsive/{responsive.bootstrap.js → responsive.bootstrap4.js} +6 -6
- data/app/assets/javascripts/effective_datatables.js +4 -4
- data/app/assets/javascripts/effective_datatables/bulk_actions.js.coffee +43 -43
- data/app/assets/javascripts/effective_datatables/events.js.coffee +7 -4
- data/app/assets/javascripts/effective_datatables/filters.js.coffee +0 -1
- data/app/assets/javascripts/effective_datatables/initialize.js.coffee +45 -49
- data/app/assets/javascripts/effective_datatables/overrides.js +12 -0
- data/app/assets/javascripts/effective_datatables/reset.js.coffee +1 -1
- data/app/assets/stylesheets/dataTables/buttons/{buttons.bootstrap.scss → buttons.bootstrap4.css} +68 -1
- data/app/assets/stylesheets/dataTables/{dataTables.bootstrap.scss → dataTables.bootstrap4.css} +44 -29
- data/app/assets/stylesheets/dataTables/responsive/{responsive.bootstrap.scss → responsive.bootstrap4.css} +3 -3
- data/app/assets/stylesheets/effective_datatables.scss +3 -4
- data/app/assets/stylesheets/effective_datatables/_overrides.scss +72 -152
- data/app/controllers/effective/datatables_controller.rb +6 -39
- data/app/helpers/effective_datatables_helper.rb +55 -50
- data/app/helpers/effective_datatables_private_helper.rb +47 -179
- data/app/models/effective/datatable.rb +16 -44
- data/app/models/effective/datatable_column.rb +0 -1
- data/app/models/effective/datatable_column_tool.rb +1 -1
- data/app/models/effective/datatable_dsl_tool.rb +3 -11
- data/app/models/effective/datatable_value_tool.rb +23 -23
- data/app/models/effective/effective_datatable/attributes.rb +13 -5
- data/app/models/effective/effective_datatable/collection.rb +3 -18
- data/app/models/effective/effective_datatable/compute.rb +6 -17
- data/app/models/effective/effective_datatable/cookie.rb +20 -19
- data/app/models/effective/effective_datatable/dsl.rb +3 -8
- data/app/models/effective/effective_datatable/dsl/bulk_actions.rb +25 -14
- data/app/models/effective/effective_datatable/dsl/datatable.rb +28 -70
- data/app/models/effective/effective_datatable/dsl/filters.rb +5 -5
- data/app/models/effective/effective_datatable/format.rb +50 -95
- data/app/models/effective/effective_datatable/params.rb +3 -8
- data/app/models/effective/effective_datatable/resource.rb +76 -137
- data/app/models/effective/effective_datatable/state.rb +15 -30
- data/app/views/effective/datatables/_actions_column.html.haml +8 -1
- data/app/views/effective/datatables/_bulk_actions_column.html.haml +1 -1
- data/app/views/effective/datatables/_filters.html.haml +11 -12
- data/app/views/effective/datatables/_resource_column.html.haml +8 -11
- data/config/effective_datatables.rb +14 -12
- data/config/routes.rb +0 -1
- data/lib/effective_datatables.rb +4 -57
- data/lib/effective_datatables/engine.rb +1 -1
- data/lib/effective_datatables/version.rb +1 -1
- metadata +20 -30
- data/app/assets/images/dataTables/sort_asc.png +0 -0
- data/app/assets/images/dataTables/sort_both.png +0 -0
- data/app/assets/images/dataTables/sort_desc.png +0 -0
- data/app/assets/javascripts/dataTables/dataTables.bootstrap.js +0 -182
- data/app/assets/javascripts/dataTables/locales/en.lang +0 -33
- data/app/assets/javascripts/dataTables/locales/es.lang +0 -36
- data/app/assets/javascripts/dataTables/locales/nl.lang +0 -30
- data/app/assets/javascripts/effective_datatables/flash.js.coffee +0 -31
- data/app/assets/javascripts/effective_datatables/inline_crud.js.coffee +0 -217
- data/app/assets/javascripts/effective_datatables/overrides.js.coffee +0 -7
- data/app/assets/javascripts/effective_datatables/reorder.js.coffee +0 -43
- data/app/assets/stylesheets/effective_datatables/_filters.scss +0 -7
- data/app/views/effective/datatables/_reorder_column.html.haml +0 -5
- data/config/locales/en.yml +0 -12
- data/config/locales/es.yml +0 -12
- data/config/locales/nl.yml +0 -12
@@ -1,43 +0,0 @@
|
|
1
|
-
reorder = (event, diff, edit) ->
|
2
|
-
change = diff.find (obj) -> obj.node == edit.triggerRow.node()
|
3
|
-
return unless change?
|
4
|
-
|
5
|
-
$table = $(event.currentTarget)
|
6
|
-
oldNode = $("<div>#{change.oldData}</div>").find('input[data-reorder-resource]')
|
7
|
-
newNode = $("<div>#{change.newData}</div>").find('input[data-reorder-resource]')
|
8
|
-
return unless oldNode? && newNode?
|
9
|
-
|
10
|
-
url = @context[0].ajax.url.replace('.json', '/reorder.json')
|
11
|
-
data = {'reorder[id]': oldNode.data('reorder-resource'), 'reorder[old]': oldNode.val(), 'reorder[new]': newNode.val(), attributes: $table.data('attributes') }
|
12
|
-
|
13
|
-
@context[0].rowreorder.c.enable = false
|
14
|
-
|
15
|
-
$.ajax(
|
16
|
-
method: 'post',
|
17
|
-
url: url,
|
18
|
-
data: data,
|
19
|
-
async: false
|
20
|
-
).fail((response, text, status) =>
|
21
|
-
$(event.target).closest('table').DataTable().flash(status, 'danger')
|
22
|
-
).always((response) =>
|
23
|
-
@context[0].rowreorder.c.enable = true
|
24
|
-
)
|
25
|
-
|
26
|
-
$.fn.DataTable.Api.register('reorder()', reorder);
|
27
|
-
|
28
|
-
$(document).on 'click', '.dataTables_wrapper a.buttons-reorder', (event) ->
|
29
|
-
event.preventDefault() # prevent the click
|
30
|
-
|
31
|
-
$link = $(event.currentTarget)
|
32
|
-
$table = $link.closest('.dataTables_wrapper').find('table.dataTable').first()
|
33
|
-
|
34
|
-
column = $table.DataTable().column('.col-_reorder')
|
35
|
-
return unless column.length > 0
|
36
|
-
|
37
|
-
if column.visible()
|
38
|
-
$table.removeClass('reordering')
|
39
|
-
else
|
40
|
-
$table.addClass('reordering')
|
41
|
-
|
42
|
-
column.visible(!column.visible())
|
43
|
-
|
@@ -1,7 +0,0 @@
|
|
1
|
-
.effective-datatables-filters { margin-bottom: 10px; }
|
2
|
-
.effective-datatables-filters-scopes { display: inline-block; margin-right: 10px; }
|
3
|
-
.effective-datatables-filters-inputs { display: inline-block; }
|
4
|
-
.effective-datatables-filters-inputs span.select2-container { display: inline-block; }
|
5
|
-
.effective-datatables-filters-inputs .form-group { margin-right: 10px; }
|
6
|
-
.effective-datatables-filters-inputs .control-label { margin-right: 3px; }
|
7
|
-
.effective-datatables-filters-btn { display: inline-block; }
|
data/config/locales/en.yml
DELETED
data/config/locales/es.yml
DELETED
data/config/locales/nl.yml
DELETED