effective_datatables 4.3.21 → 4.3.22

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: d16abc968c44876025dde5fcd633faf328642df6
4
- data.tar.gz: 2c4f38ae922eb00e4dc5dbf46f9fb843dd3de926
3
+ metadata.gz: 85c4d234a41d794bc05590d5908a0cab2b5b9271
4
+ data.tar.gz: 2a39922c804f7455053c7bca291dba9baf8fb5ef
5
5
  SHA512:
6
- metadata.gz: f22ddb2a8b4d015a65804a6f245652fb1f204f36878c898c786f1bbd0c62d8c886630097e27ffd95163a0abe2e82ac3c9fb992afdaa0e56fcc90a2d7d5d9d97c
7
- data.tar.gz: 3da4b7eab6631e79dd1d7fe8e25b4d2cb8bb0e7baf7414389f0a528321c60454a254f030050b9377ac2f522a562d946ff0ee65797cc47bfb2b6c47e58b737728
6
+ metadata.gz: 59be28e8ab3d8d34c37b2c54601471b4b760dfa64efed01c7d37cb464d8d2861a8c88504e9245c6c1fbb56816b54fccf267051223e6a376fdb6c50e10e9e61dc
7
+ data.tar.gz: a2cc1cbcc432e583f3379c0e876b6da967a04f9f64d3f934a9667e70e36f3fd30c4f655adaed6b26341f2e9ad0cae4edabe14438f8e418e90d2bde7596810e2a
@@ -11,7 +11,7 @@ $(document).on 'ajax:beforeSend', '.dataTables_wrapper .col-actions', (e, xhr, s
11
11
  $params = $.param({_datatable_id: $table.attr('id'), _datatable_cookie: $table.data('cookie'), _datatable_action: true })
12
12
  settings.url += (if settings.url.indexOf('?') == -1 then '?' else '&') + $params
13
13
 
14
- if $action.closest('.effective-datatables-inline-row').length > 0
14
+ if $action.closest('.effective-datatables-inline-row,table.dataTable').hasClass('effective-datatables-inline-row')
15
15
  # Nothing.
16
16
  else if $action.closest('tr').parent().prop('tagName') == 'THEAD'
17
17
  beforeNew($action)
@@ -86,7 +86,8 @@ beforeNew = ($action) ->
86
86
  # Append spinner and show Processing
87
87
  $th.append($table.data('spinner'))
88
88
  $table.DataTable().flash()
89
- $table.one 'draw.dt', (event) -> $th.find('a').show().siblings('svg').remove()
89
+ $table.one 'draw.dt', (event) ->
90
+ $th.find('a').show().siblings('svg').remove() if event.target == event.currentTarget
90
91
 
91
92
  afterNew = ($action) ->
92
93
  $tr = $action.closest('tr')
@@ -99,7 +100,7 @@ afterNew = ($action) ->
99
100
  $table.children('tbody').prepend($tr)
100
101
 
101
102
  expand($table)
102
- $tr.find('form').attr('data-remote', true).trigger('effective-bootstrap:initialize')
103
+ $tr.find('form').attr('data-remote', true).trigger('turbolinks:load')
103
104
  $tr.hide().fadeIn()
104
105
 
105
106
  beforeEdit = ($action) ->
@@ -126,7 +127,7 @@ afterEdit = ($action) ->
126
127
  $tr.addClass('effective-datatables-inline-row')
127
128
 
128
129
  expand($table)
129
- $tr.find('form').attr('data-remote', true).trigger('effective-bootstrap:initialize')
130
+ $tr.find('form').attr('data-remote', true).trigger('turbolinks:load')
130
131
  $tr.hide().fadeIn()
131
132
 
132
133
  # This is when one of the resource actions completes
@@ -149,11 +150,13 @@ buildRow = (length, payload) ->
149
150
 
150
151
  expand = ($table) ->
151
152
  $wrapper = $table.closest('.dataTables_wrapper').addClass('effective-datatables-inline-expanded')
152
- $table.one 'draw.dt', (event) -> $wrapper.removeClass('effective-datatables-inline-expanded')
153
+ $table.on 'draw.dt', (event) ->
154
+ $wrapper.removeClass('effective-datatables-inline-expanded') if event.target == event.currentTarget
153
155
 
154
156
  cancel = ($table) ->
155
157
  $wrapper = $table.closest('.dataTables_wrapper')
156
- $wrapper.removeClass('effective-datatables-inline-expanded') if $wrapper.find('.effective-datatables-inline-row').length == 0
158
+ if $wrapper.find('.effective-datatables-inline-row').length == 0
159
+ $wrapper.removeClass('effective-datatables-inline-expanded')
157
160
 
158
161
  refreshDatatables = ($source) ->
159
162
  return unless EffectiveForm.remote_form_refresh_datatables.length > 0
@@ -43,6 +43,8 @@ table.dataTable > thead {
43
43
  tr { opacity: 0.4; }
44
44
 
45
45
  tr.effective-datatables-inline-row {
46
+ tr { opacity: 1.0; }
47
+
46
48
  visibility: visible;
47
49
  opacity: 1.0;
48
50
 
@@ -14,8 +14,11 @@ module Effective
14
14
  def datatables_inline_request?
15
15
  return @_datatables_inline_request unless @_datatables_inline_request.nil?
16
16
 
17
- @_datatables_inline_request =
18
- (view && view.params[:_datatable_cookie] && cookie_keys.include?(view.params[:_datatable_cookie])) == true
17
+ @_datatables_inline_request = (
18
+ view &&
19
+ view.params[:_datatable_id].to_s.split('-')[0...-1] == to_param.split('-')[0...-1] &&
20
+ cookie_keys.include?(view.params[:_datatable_cookie])
21
+ )
19
22
  end
20
23
 
21
24
  def params
@@ -91,6 +91,8 @@ module Effective
91
91
  if datatables_ajax_request?
92
92
  load_filter_params!
93
93
  load_ajax_state!
94
+ elsif datatables_inline_request?
95
+ load_cookie_state!
94
96
  elsif cookie.present? && cookie[:params] == params.length && EffectiveDatatables.save_state
95
97
  load_cookie_state!
96
98
  else
@@ -1,3 +1,3 @@
1
1
  module EffectiveDatatables
2
- VERSION = '4.3.21'.freeze
2
+ VERSION = '4.3.22'.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: 4.3.21
4
+ version: 4.3.22
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: 2019-01-28 00:00:00.000000000 Z
11
+ date: 2019-02-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails