effective_datatables 4.10.6 → 4.11.1

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: b8b4404aa7ed71091b5136e13f24348b67a2d591933b386a7f7a3d47c698cbd0
4
- data.tar.gz: d0bfa93d8b63174ed043cd4cb4de596c49b51dccd75cb00d1e56a7d7753522a9
3
+ metadata.gz: 026730ba20562ddac0f28a5bde43b522207a59c4c9ae673545405b0c4d005a55
4
+ data.tar.gz: 72e5ef907b2c0b5fd94274a14f9025d34767abe5ad4aa56396d7888b7eb28b91
5
5
  SHA512:
6
- metadata.gz: 645fd35fd30ad091d3a11e159b670a3def7e7f08d20af6646025f7d961214b8a995599dc824142378b4e97fe7c79eae02aed9db54e7d1081266c66c8350ea373
7
- data.tar.gz: d4aa64b1d27c777537df67803031c194a764af723afa99fb34111f9f5f7bda9205530db9a4ca030dffaae99675fc653a116b6cbb937f1547f107f10676f976d3
6
+ metadata.gz: 7635a47dd2047b7dec807a11d881f6babc37603135c194a8303b1ae8307ec8628279b348543e806339548dd7e5f296fe784a3f82da8c2fd8ad0224b1e6f1d242
7
+ data.tar.gz: 5352f10cb81378464d412200784e255c197837fe67451182fe6b2e6d570673c627c3b2d0819e6831c3d7eb51290411339d8cd64f2cef9b66069407c375686847
@@ -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')
@@ -45,7 +45,7 @@ module Effective
45
45
  Rails.logger.info "COLUMN TOOL: order_column #{column.to_s} #{direction} #{sql_column}" if EffectiveDatatables.debug
46
46
 
47
47
  if column[:sql_as_column]
48
- collection.order("#{sql_column} #{datatable.effective_resource.sql_direction(direction)}")
48
+ collection.order(Arel.sql("#{sql_column} #{datatable.effective_resource.sql_direction(direction)}"))
49
49
  else
50
50
  Effective::Resource.new(collection)
51
51
  .order(column[:name], direction, as: column[:as], sort: column[:sort], sql_column: column[:sql_column], limit: datatable.limit)
@@ -6,11 +6,13 @@ module EffectiveDatatables
6
6
 
7
7
  # Include Helpers to base application
8
8
  initializer 'effective_datatables.action_controller' do |app|
9
- ActiveSupport.on_load :action_controller_base do
10
- helper EffectiveDatatablesHelper
11
- helper EffectiveDatatablesPrivateHelper
9
+ app.config.to_prepare do
10
+ ActiveSupport.on_load :action_controller_base do
11
+ helper EffectiveDatatablesHelper
12
+ helper EffectiveDatatablesPrivateHelper
12
13
 
13
- ActionController::Base.send :include, ::EffectiveDatatablesControllerHelper
14
+ ActionController::Base.send :include, ::EffectiveDatatablesControllerHelper
15
+ end
14
16
  end
15
17
  end
16
18
 
@@ -1,3 +1,3 @@
1
1
  module EffectiveDatatables
2
- VERSION = '4.10.6'.freeze
2
+ VERSION = '4.11.1'.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.10.6
4
+ version: 4.11.1
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-03-14 00:00:00.000000000 Z
11
+ date: 2022-05-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails