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 +4 -4
- data/app/assets/javascripts/effective_datatables/inline_crud.js.coffee +9 -6
- data/app/assets/stylesheets/effective_datatables/_overrides.scss +2 -0
- data/app/models/effective/effective_datatable/params.rb +5 -2
- data/app/models/effective/effective_datatable/state.rb +2 -0
- 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: 85c4d234a41d794bc05590d5908a0cab2b5b9271
|
4
|
+
data.tar.gz: 2a39922c804f7455053c7bca291dba9baf8fb5ef
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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').
|
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) ->
|
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('
|
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('
|
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.
|
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
|
-
|
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
|
@@ -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
|
-
|
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
|
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.
|
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-
|
11
|
+
date: 2019-02-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|