effective_datatables 4.11.0 → 4.12.0

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: 92dfaf548b47e5323f1e08f3ce7167a871c90e7d35deaa403491fba74bf827f2
4
- data.tar.gz: 611e25b2241638476ef4f3d77a18921ef07e95c7a5fe262839292e789310039a
3
+ metadata.gz: 42b5024f89eb0023d4726035fd8312fae684f291cc108ca3adfb16bdf830aac5
4
+ data.tar.gz: 411a3ec031d8ec63b7f12fa71d71ba5aa50743b24c145d494d814e77081aea40
5
5
  SHA512:
6
- metadata.gz: f86dd771a3e626feb40ab1766d13939ccb1dc2061b89f21ba87bd174e0ae5a5e31183d13591844434cf759e53378794e9414f2cdee6173e6357b95bb8ef6338b
7
- data.tar.gz: a2978ce18ce4f9ef15bbf760591dc13dd2bf7db1acbc8a6d3a77b236b690efec4c7d0d741a73c833a90ea1655b8c8ba8e46e878ee7d93ef904e8f4debb7b665e
6
+ metadata.gz: 9b14bbea43b5c06f24cec46c1ffbee82dc86806deefc0bd81dc74f12dd73a850004b4dac59dac83fd24fe69a4cf75b281a2f498b4752035d4a13d2be2ef1c07c
7
+ data.tar.gz: 2cbf3ed396bb3be677531d02220de5fa1952ea01c481c7ffb426429de9ed0050a65923debfba606cbe0344f57ebe79fe33f1ef464b13959140dc2ce0c5bf020f
@@ -19,11 +19,12 @@ $(document).on 'change', ".dataTables_wrapper input[data-role='bulk-actions']",
19
19
 
20
20
  toggleDropdown = ($wrapper) ->
21
21
  $bulkActions = $wrapper.children().first().find('.buttons-bulk-actions').children('button')
22
+ selected = $wrapper.find("input[data-role='bulk-action']:checked").length
22
23
 
23
- if $wrapper.find("input[data-role='bulk-action']:checked").length > 0
24
- $bulkActions.removeAttr('disabled')
24
+ if selected > 0
25
+ $bulkActions.removeAttr('disabled').text("Bulk Actions (#{selected} items)")
25
26
  else
26
- $bulkActions.attr('disabled', 'disabled')
27
+ $bulkActions.attr('disabled', 'disabled').text('Bulk Actions')
27
28
 
28
29
  restoreSelected = ($table, selected) ->
29
30
  $bulkActions = $table.closest('.dataTables_wrapper').children().first().find('.buttons-bulk-actions').children('button')
@@ -18,7 +18,7 @@ module Effective
18
18
  @view = datatable.view
19
19
  end
20
20
 
21
- def method_missing(method, *args, &block)
21
+ def method_missing(method, *args, **kwargs, &block)
22
22
  # Catch a common error
23
23
  if [:bulk_actions, :charts, :collection, :filters].include?(method) && in_datatables_do_block
24
24
  raise "#{method} block must be declared outside the datatable do ... end block"
@@ -26,15 +26,15 @@ module Effective
26
26
 
27
27
  if datatable.respond_to?(method)
28
28
  if block_given?
29
- datatable.send(method, *args) { yield }
29
+ datatable.send(method, *args, **kwargs) { yield }
30
30
  else
31
- datatable.send(method, *args)
31
+ datatable.send(method, *args, **kwargs)
32
32
  end
33
33
  elsif view.respond_to?(method)
34
34
  if block_given?
35
- view.send(method, *args) { yield }
35
+ view.send(method, *args, **kwargs) { yield }
36
36
  else
37
- view.send(method, *args)
37
+ view.send(method, *args, **kwargs)
38
38
  end
39
39
  else
40
40
  super
@@ -93,6 +93,7 @@ module Effective
93
93
  collection.select! do |row|
94
94
  obj = row[index]
95
95
  value = obj_to_value(row[index], column, row)
96
+ next if value.blank?
96
97
 
97
98
  case column[:as]
98
99
  when :boolean
@@ -36,7 +36,7 @@ module Effective
36
36
 
37
37
  opts[:class] = [opts[:class], 'dropdown-item'].compact.join(' ')
38
38
 
39
- link_to(title, url, opts)
39
+ link_to(title, url, **opts)
40
40
  end
41
41
 
42
42
  end
@@ -1,3 +1,3 @@
1
1
  module EffectiveDatatables
2
- VERSION = '4.11.0'.freeze
2
+ VERSION = '4.12.0'.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.11.0
4
+ version: 4.12.0
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: 2022-04-06 00:00:00.000000000 Z
11
+ date: 2022-08-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails