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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5f740fcfa8103e4a41cd19d78627e660ed8261d7
4
- data.tar.gz: 2a38dab4e9bfd6532d6455abdda04f50d928680b
3
+ metadata.gz: a60414a14abdc45d87dbda78636a95a3e9a0b7e1
4
+ data.tar.gz: 5c97dbdd9932315966189a6702591e57406623cc
5
5
  SHA512:
6
- metadata.gz: 28352978829362e667d377d03864e7cde3b9f4ce72230bd61d3c68aa97ba0f29f8ef49697171da41d84931fee1b4beea6229dd9f232e7276b49d82914f3579db
7
- data.tar.gz: 255b54c6a2763303e7b9d423fa74cc846fe7fa771bd4292a4681e9b2bb90e70d4e1819bb937d88d0132cb92723f30791dcafab4dba6017bcb449e2e7f556aa03
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-datatable-filters')
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-4'l><'col-sm-8'B>><'row'<'col-sm-12'tr>><'row'<'col-sm-6'i><'col-sm-6'p>>"
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': 'Show _MENU_ per page'}
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-datatable-filters[aria-controls='#{$table.attr('id')}']").first()
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: 10px 0px 0px 6px;
138
+ padding: 5px 0px 0px 6px;
140
139
  }
141
140
 
142
141
  // Collapsed responsive view
@@ -1,22 +1,27 @@
1
- .effective-datatable-filters{'aria-controls': datatable.to_param}
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
- .btn-toolbar
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
- - datatable._filters.each do |name, opts|
12
- = form.input name, label: opts[:label], required: false, value: datatable.state[:filter][name],
13
- as: opts[:as],
14
- collection: opts[:input_html].delete(:collection),
15
- multiple: opts[:input_html].delete(:multiple),
16
- input_html: (({name: ''} unless datatable._filters_form_required?) || {}).merge(opts[:input_html])
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
- .btn-group
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-datatable-filters', 'data-apply-datatable-filters': true
27
+ = link_to 'Apply', '#', class: 'btn btn-primary btn-sm btn-effective-datatables-filters', 'data-apply-datatable-filters': true
@@ -1,3 +1,3 @@
1
1
  module EffectiveDatatables
2
- VERSION = '3.2.5'.freeze
2
+ VERSION = '3.2.6'.freeze
3
3
  end
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.5
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-05 00:00:00.000000000 Z
11
+ date: 2017-10-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails