effective_datatables 4.9.3 → 4.9.4

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
  SHA256:
3
- metadata.gz: 4ff0abf72b8f131a02f3ced253e086eae03c145d981e5c266e6cc2c896d811cd
4
- data.tar.gz: e51004fc66c9801839e7f26027e07c1764e419b67da580250a313b83b6158be8
3
+ metadata.gz: 768310a5434c778a3e11512125d661bc4ce443a277bb7e15581e50224b81c48f
4
+ data.tar.gz: 6b05137c54ef11ce9801b2e1fc48ee525641d2dd5507b7259e80c3387335404b
5
5
  SHA512:
6
- metadata.gz: 94a88b880e49ded7dddbd17fa4fbff3115e266c1fdb5a8550bc7039e14aa7483f73dceedbe6ff60f1ebd3ee8c520c126792970e82345517330ac8962ec1ae856
7
- data.tar.gz: d9d8d9257057d8bfca9d38d8be0096b542a4877d452e7b5b33de3743f66d2d7c5cb1e5cf99fec1a8eef3eae15621f30b664f1096000f112ca2bbafe14c71cfbb
6
+ metadata.gz: edf03e2147e95afd515bc357ac5436dca96c0d3f1aa4fd36ac040bc1cc0885a1a34a0d6ff69897b61bafe8542b46447bc59adc96d42167fd4efc6b98cd65006b
7
+ data.tar.gz: 7027f034cee83b584d50290a34674295b3aca4d7b6cb0121ebd1dd052833ffdfaa0be50e26d493d736c8d8e7730aa89dc666b42c0e1219ba33c6ec495f9c01da
@@ -41,13 +41,25 @@ restoreSelected = ($table, selected) ->
41
41
 
42
42
  if present then $bulkActions.removeAttr('disabled') else $bulkActions.attr('disabled', 'disabled')
43
43
 
44
- #### Bulk Action link behaviour
44
+ # rails_ujs data-confirm requires special attention
45
+ # https://github.com/rails/rails/blob/main/actionview/app/assets/javascripts/rails-ujs/features/confirm.coffee
46
+ $(document).on 'confirm:complete', '.dataTables_wrapper .buttons-bulk-actions a', (event) ->
47
+ if event.originalEvent.detail && event.originalEvent.detail[0] == true
48
+ doBulkActionPost(event)
49
+ (window.Rails || $.rails).stopEverything(event)
50
+ return false
51
+
45
52
  $(document).on 'click', '.dataTables_wrapper .buttons-bulk-actions a', (event) ->
46
- event.preventDefault() # prevent the click
47
- document.cookie = 'ids=; expires = Thu, 01 Jan 1970 00:00:00 GMT'
53
+ unless $(event.currentTarget).data('confirm')
54
+ doBulkActionPost(event)
55
+ event.preventDefault()
56
+
57
+ doBulkActionPost = (event) ->
58
+ $bulkAction = $(event.currentTarget) # This is the regular <a href=...> tag maybe with data-confirm
59
+
60
+ document.cookie = 'ids=; expires=Thu, 01 Jan 1970 00:00:00 GMT'
48
61
  localStorage.removeItem('ids')
49
62
 
50
- $bulkAction = $(event.currentTarget) # This is a regular <a href=...> tag
51
63
  $wrapper = $bulkAction.closest('.dataTables_wrapper')
52
64
  $table = $wrapper.find('table.dataTable').first()
53
65
  $processing = $table.siblings('.dataTables_processing').first()
@@ -1,3 +1,3 @@
1
1
  module EffectiveDatatables
2
- VERSION = '4.9.3'.freeze
2
+ VERSION = '4.9.4'.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.9.3
4
+ version: 4.9.4
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: 2021-09-09 00:00:00.000000000 Z
11
+ date: 2021-09-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails