effective_datatables 3.2.5 → 3.2.6
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/filters.js.coffee +1 -1
- data/app/assets/javascripts/effective_datatables/initialize.js.coffee +3 -3
- data/app/assets/stylesheets/effective_datatables/_filters.scss +6 -0
- data/app/assets/stylesheets/effective_datatables/_overrides.scss +1 -2
- data/app/views/effective/datatables/_filters.html.haml +16 -11
- 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: a60414a14abdc45d87dbda78636a95a3e9a0b7e1
|
4
|
+
data.tar.gz: 5c97dbdd9932315966189a6702591e57406623cc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5b47935fefc03832d781d6f92e37c4254c54db5b41cc1808f152f8c7668912f71c9afdb59b0a37877eb989628577c52f7caca977f4a090590005d86dd336f1c2
|
7
|
+
data.tar.gz: d77569664a318d3e60b23cbd6533b62ef0049f56e6f11dafef8e9b641bbb7d9c1fb0cde5767aba2739fcae6a3a21f73925d16b9e7d468e448cf987131659aee9
|
@@ -1,6 +1,6 @@
|
|
1
1
|
$(document).on 'click', 'a[data-apply-datatable-filters]', (event) ->
|
2
2
|
event.preventDefault()
|
3
|
-
$form = $(event.currentTarget).closest('.effective-
|
3
|
+
$form = $(event.currentTarget).closest('.effective-datatables-filters')
|
4
4
|
$table = $('#' + $form.attr('aria-controls'))
|
5
5
|
$table.DataTable().draw()
|
6
6
|
|
@@ -49,9 +49,9 @@ initializeDataTables = ->
|
|
49
49
|
deferLoading: [datatable.data('display-records'), datatable.data('total-records')]
|
50
50
|
deferRender: true
|
51
51
|
displayStart: datatable.data('display-start')
|
52
|
-
dom: "<'row'<'col-sm-
|
52
|
+
dom: "<'row'<'col-sm-12'B>><'row'<'col-sm-12'tr>><'row'<'col-sm-2'l><'col-sm-4'i><'col-sm-6'p>>"
|
53
53
|
iDisplayLength: datatable.data('display-length')
|
54
|
-
language: { 'lengthMenu': '
|
54
|
+
language: { 'lengthMenu': '_MENU_ per page'}
|
55
55
|
lengthMenu: [[10, 25, 50, 100, 250, 1000, 9999999], ['10', '25', '50', '100', '250', '1000', 'All']]
|
56
56
|
order: datatable.data('display-order')
|
57
57
|
processing: true
|
@@ -61,7 +61,7 @@ initializeDataTables = ->
|
|
61
61
|
api.columns().flatten().each (index) => params['columns'][index]['visible'] = api.column(index).visible()
|
62
62
|
|
63
63
|
$table = $(api.table().node())
|
64
|
-
$form = $(".effective-
|
64
|
+
$form = $(".effective-datatables-filters[aria-controls='#{$table.attr('id')}']").first()
|
65
65
|
|
66
66
|
params['cookie'] = $table.data('cookie')
|
67
67
|
|
@@ -0,0 +1,6 @@
|
|
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 .form-group { margin-right: 10px; }
|
5
|
+
.effective-datatables-filters-inputs .control-label { margin-right: 3px; }
|
6
|
+
.effective-datatables-filters-btn { display: inline-block; }
|
@@ -64,7 +64,6 @@ div.dataTables_wrapper div.dataTables_processing {
|
|
64
64
|
margin-bottom: 4px;
|
65
65
|
color: #909090;
|
66
66
|
font-size: 12px;
|
67
|
-
padding-left: 6px;
|
68
67
|
}
|
69
68
|
|
70
69
|
// Buttons
|
@@ -136,7 +135,7 @@ ul.dt-button-collection {
|
|
136
135
|
div.dataTables_wrapper div.dataTables_info {
|
137
136
|
color: #909090;
|
138
137
|
font-size: 12px;
|
139
|
-
padding:
|
138
|
+
padding: 5px 0px 0px 6px;
|
140
139
|
}
|
141
140
|
|
142
141
|
// Collapsed responsive view
|
@@ -1,22 +1,27 @@
|
|
1
|
-
.effective-
|
1
|
+
.effective-datatables-filters{'aria-controls': datatable.to_param}
|
2
2
|
= simple_form_for :filters, url: (datatable._form[:url] || '#'), method: datatable._form[:verb], html: { class: 'form-inline' } do |form|
|
3
3
|
|
4
4
|
- if datatable._scopes.present?
|
5
|
-
.
|
5
|
+
.effective-datatables-filters-scopes
|
6
6
|
= form.input :scope, label: false, required: false, checked: datatable.state[:scope],
|
7
7
|
as: (defined?(EffectiveFormInputs) ? :effective_radio_buttons : :radio_buttons),
|
8
8
|
collection: datatable._scopes.map { |name, opts| [opts[:label], name] },
|
9
|
-
buttons: true
|
9
|
+
buttons: true,
|
10
|
+
wrapper_html: {class: 'btn-group-sm'}
|
10
11
|
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
12
|
+
- if datatable._filters.present?
|
13
|
+
.effective-datatables-filters-inputs
|
14
|
+
- datatable._filters.each do |name, opts|
|
15
|
+
= form.input name, label: opts[:label], required: false, value: datatable.state[:filter][name],
|
16
|
+
as: opts[:as],
|
17
|
+
collection: opts[:input_html].delete(:collection),
|
18
|
+
multiple: opts[:input_html].delete(:multiple),
|
19
|
+
input_html: (({name: ''} unless datatable._filters_form_required?) || {}).merge(opts[:input_html]),
|
20
|
+
wrapper_html: {class: 'form-group-sm'}
|
17
21
|
|
18
|
-
|
22
|
+
- if datatable._scopes.present? || datatable._filters.present?
|
23
|
+
.effective-datatables-filters-btn
|
19
24
|
- if datatable._filters_form_required?
|
20
25
|
= form.button :submit, 'Apply', 'data-disable-with': 'Applying...'
|
21
26
|
- else
|
22
|
-
= link_to 'Apply', '#', class: 'btn btn-primary btn-effective-
|
27
|
+
= link_to 'Apply', '#', class: 'btn btn-primary btn-sm btn-effective-datatables-filters', 'data-apply-datatable-filters': true
|
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: 3.2.
|
4
|
+
version: 3.2.6
|
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: 2017-10-
|
11
|
+
date: 2017-10-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|