effective_datatables 4.3.19 → 4.3.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/app/assets/javascripts/effective_datatables/initialize.js.coffee +4 -2
- data/app/assets/javascripts/effective_datatables/inline_crud.js.coffee +3 -2
- data/app/assets/javascripts/effective_datatables/reorder.js.coffee +2 -1
- 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: bdd07e900a976b859296be599b528999fc3a405c
|
4
|
+
data.tar.gz: 30208e6488de5c84b9311409f98f04a0c718811b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d2c242866ddec34922c6720f5794e6efe6e1e866c7d4874540f4fd7b05d67a5a6de87ab54a5203e7f05c889da5e81a13a717f46a012ab54d3a5bc7b5079dcd7e
|
7
|
+
data.tar.gz: d9996dfc30d2e7c0ac9f8d81da9fcb782224e88e7d0c4468be7c0d6256d24a1391fa4bef2a922190e1be5e4f6c69f2ee064d293094a8279d2ce8fbdbcf0b69b5
|
@@ -1,5 +1,5 @@
|
|
1
|
-
initializeDataTables = ->
|
2
|
-
$('table.effective-datatable:not(.initialized)').each ->
|
1
|
+
initializeDataTables = (target) ->
|
2
|
+
$(target || document).find('table.effective-datatable:not(.initialized)').each ->
|
3
3
|
datatable = $(this)
|
4
4
|
options = datatable.data('options') || {}
|
5
5
|
buttons_export_columns = options['buttons_export_columns'] || ':not(.col-actions)'
|
@@ -181,6 +181,8 @@ destroyDataTables = ->
|
|
181
181
|
$('table.effective-datatable').each -> try $(this).removeClass('initialized').DataTable().destroy()
|
182
182
|
|
183
183
|
$ -> initializeDataTables()
|
184
|
+
$(document).on 'effective-datatables:initialize', (event) -> initializeDataTables(event.currentTarget)
|
185
|
+
|
184
186
|
$(document).on 'page:change', -> initializeDataTables()
|
185
187
|
$(document).on 'turbolinks:load', -> initializeDataTables()
|
186
188
|
$(document).on 'turbolinks:render', -> initializeDataTables()
|
@@ -118,10 +118,10 @@ beforeEdit = ($action) ->
|
|
118
118
|
afterEdit = ($action) ->
|
119
119
|
$tr = $action.closest('tr')
|
120
120
|
$table = $tr.closest('table')
|
121
|
-
$tr.data('inline-form-original-html', $tr.html())
|
122
121
|
|
123
122
|
html = buildRow($tr.children('td').length, EffectiveForm.remote_form_payload)
|
124
123
|
|
124
|
+
$tr.data('inline-form-original-html', $tr.children().detach())
|
125
125
|
$tr.html(html)
|
126
126
|
$tr.addClass('effective-datatables-inline-row')
|
127
127
|
|
@@ -189,7 +189,8 @@ $(document).on 'click', ".dataTables_wrapper a[data-role='inline-form-cancel']",
|
|
189
189
|
$td = $tr.children('.col-actions').first()
|
190
190
|
$td.children('svg').remove()
|
191
191
|
|
192
|
-
$td.find('.dropdown-toggle')
|
192
|
+
$toggle = $td.find('.dropdown-toggle')
|
193
|
+
$toggle.dropdown('toggle') if $toggle.parent().hasClass('show')
|
193
194
|
$td.children('.btn-group').show()
|
194
195
|
$td.children('a').show()
|
195
196
|
|
@@ -2,12 +2,13 @@ reorder = (event, diff, edit) ->
|
|
2
2
|
change = diff.find (obj) -> obj.node == edit.triggerRow.node()
|
3
3
|
return unless change?
|
4
4
|
|
5
|
+
$table = $(event.currentTarget)
|
5
6
|
oldNode = $("<div>#{change.oldData}</div>").find('input[data-reorder-resource]')
|
6
7
|
newNode = $("<div>#{change.newData}</div>").find('input[data-reorder-resource]')
|
7
8
|
return unless oldNode? && newNode?
|
8
9
|
|
9
10
|
url = @context[0].ajax.url.replace('.json', '/reorder.json')
|
10
|
-
data = {'reorder[id]': oldNode.data('reorder-resource'), 'reorder[old]': oldNode.val(), 'reorder[new]': newNode.val()}
|
11
|
+
data = {'reorder[id]': oldNode.data('reorder-resource'), 'reorder[old]': oldNode.val(), 'reorder[new]': newNode.val(), _datatable_cookie: $table.data('cookie') }
|
11
12
|
|
12
13
|
@context[0].rowreorder.c.enable = false
|
13
14
|
|
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.20
|
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-
|
11
|
+
date: 2019-01-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|