effective_datatables 4.3.12 → 4.3.13

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: 29a6e0d0478885ad23309fecf7867b03dca64adf
4
- data.tar.gz: 0b61e07209624deada4c8d3eaf250582cbb2c2b4
3
+ metadata.gz: becca55d8f11979e333f3f0a40e587d79e2280d7
4
+ data.tar.gz: ad7d4200759f221445c283c4b0afdca9166165bf
5
5
  SHA512:
6
- metadata.gz: 487154867732b2b954e9f1966246b6d9e32d919cc885ec8f98771bf020f58a1c8ed85177214442187357b1b464fa8063affffe6b9ba2f18a983e9d54022d98b3
7
- data.tar.gz: 5fba36836e3c439dfa736e67fa9bb84ef4ef50c4b46880d9431effb321f1d7c9cb1052338e56b139926aa7558fe7b62ede4e2fc52f62def9f5e4b7a9e4dbbbf1
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 1000)
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
- # About to do a resource action, or fetch a partial. Show loading.
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. This is a save action from within the inline form.
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: 1em;
133
- left: 50%;
134
- width: 300px;
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: 'bulk_actions_resources[]', id: "datatable_bulk_actions_resource_#{id}", value: id, type: 'checkbox', autocomplete: 'off', 'data-role': 'bulk-action' }
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}" }
@@ -1,3 +1,3 @@
1
1
  module EffectiveDatatables
2
- VERSION = '4.3.12'.freeze
2
+ VERSION = '4.3.13'.freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: effective_datatables
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.3.12
4
+ version: 4.3.13
5
5
  platform: ruby
6
6
  authors:
7
7
  - Code and Effect