effective_datatables 3.3.0 → 3.3.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
  SHA1:
3
- metadata.gz: d15e87f91c336f09837c05c1cd19ae3eb109aa5c
4
- data.tar.gz: 02baa43cac7e7ecb1b0dbdee89d22512e98af70a
3
+ metadata.gz: b6617dd89c63c469a1b13e5cc33d42d17d38f485
4
+ data.tar.gz: 35c4b532d397f4b39a44b4f48cca0014ff9c88b2
5
5
  SHA512:
6
- metadata.gz: 4df1c018bc13eb6bfe06a9309b52081dfe5f7840fc136a7d9b31d8ac06d8d1fde0c1ea1e66bbee7a3616238fba866f9eb572e3c75d7b8ffb451b33411e1dc4fb
7
- data.tar.gz: 6daf450e7860fa17e318c1b29e65b3cad892eb3b94fc235186db44b3c31073c9c08621b3c9963b21a3bae29fc602dc54939645946df68ae34be87f7c8e79b4dd
6
+ metadata.gz: 408903d12b738461044519d44a608f1d231b153098d699fb37ef85010feb0d746d74a924bd437dcfe8f5affde12267230bb56ba9e1bde4f45348e6319d764a30
7
+ data.tar.gz: ca62715eec66e12d5dfc332c712ee3fb6c36dcb3aea938dc186a49f6af379e564d69c827f746fc539626a40f8d37005cf0293988ed3983ac13a918dea7db99a8
data/README.md CHANGED
@@ -189,7 +189,7 @@ class PostsDatatable < Effective::Datatable
189
189
  # The user's selected filters, search, sort, length, column visibility and pagination settings are saved between visits
190
190
  # on a per-table basis and can be Reset with a button
191
191
  datatable do
192
- length 25 # 5, 10, 25, 50, 100, 1000, :all
192
+ length 25 # 5, 10, 25, 50, 100, 500, :all
193
193
  order :updated_at, :desc
194
194
 
195
195
  # Renders a column of checkboxes to select items for any bulk_actions
@@ -559,7 +559,7 @@ The `glyphicon_to` helper is part of the [effective_resources](https://github.co
559
559
 
560
560
  ### length
561
561
 
562
- Sets the default number of rows per page. Valid lengths are `5`, `10`, `25`, `50`, `100`, `250`, `1000`, `:all`
562
+ Sets the default number of rows per page. Valid lengths are `5`, `10`, `25`, `50`, `100`, `250`, `500`, `:all`
563
563
 
564
564
  When not specified, effective_datatables uses the default as per the `config/initializers/effective_datatables.rb` or 25.
565
565
 
@@ -49,10 +49,10 @@ initializeDataTables = ->
49
49
  deferLoading: [datatable.data('display-records'), datatable.data('total-records')]
50
50
  deferRender: true
51
51
  displayStart: datatable.data('display-start')
52
- dom: "<'row'<'col-sm-12'B>><'row'<'col-sm-12'tr>><'row'<'col-sm-2'l><'col-sm-4'i><'col-sm-6'p>>"
52
+ dom: "<'row'<'col-sm-12'B>><'row'<'col-sm-12'tr>><'row'<'col-sm-6 dataTables_entries'il><'col-sm-6'p>>"
53
53
  iDisplayLength: datatable.data('display-length')
54
- language: { 'lengthMenu': '_MENU_ per page'}
55
- lengthMenu: [[10, 25, 50, 100, 250, 1000, 9999999], ['10', '25', '50', '100', '250', '1000', 'All']]
54
+ language: { 'lengthMenu': '&nbsp;with _MENU_ per page'}
55
+ lengthMenu: [[10, 25, 50, 100, 250, 500, 9999999], ['10', '25', '50', '100', '250', '500', 'All']]
56
56
  order: datatable.data('display-order')
57
57
  processing: true
58
58
  responsive: true
@@ -185,7 +185,7 @@ initializeDataTables = ->
185
185
 
186
186
  # Apply EffectiveFormInputs to the Show x per page dropdown
187
187
  if datatable.data('effective-form-inputs')
188
- try table.closest('.dataTables_wrapper').find('.dataTables_length select').removeAttr('name').select2()
188
+ try table.closest('.dataTables_wrapper').find('.dataTables_length select').removeAttr('name').select2(minimumResultsForSearch: 100)
189
189
 
190
190
  destroyDataTables = ->
191
191
  $('table.effective-datatable').each ->
@@ -68,10 +68,38 @@ div.dataTables_wrapper div.dataTables_processing {
68
68
  width: 70%;
69
69
  }
70
70
 
71
- // Show x per page
72
- .dataTables_wrapper div.dataTables_length {
71
+ // Datatables entries
72
+ @media screen and (max-width: 767px) {
73
+ div.dataTables_wrapper div.dataTables_entries { text-align: center; }
74
+ }
75
+
76
+ .dataTables_wrapper .dataTables_entries {
73
77
  color: #909090;
74
78
  font-size: 12px;
79
+
80
+ // Showing 1 to 2 of 2 entries (filtered from 10 total entries)
81
+ div.dataTables_info {
82
+ display: inline-block;
83
+ padding: 5px 0px 6px 6px;
84
+ }
85
+
86
+ // with 25 per page
87
+ div.dataTables_length {
88
+ display: inline-block;
89
+
90
+ // Apply custom style to the inline x per page select
91
+ span.select2-container {
92
+ margin: 0px -3px 3px -3px;
93
+ max-width: 45px;
94
+
95
+ .select2-selection { border: none; }
96
+ .select2-selection__rendered { padding: 0px; color: #909090; }
97
+ }
98
+
99
+ span.select2-container.select2-container--open { max-width: 60px; }
100
+ span.select2-container.select2-container--focus { border: none; box-shadow: none; }
101
+ span.select2-container--focus > .selection > .select2-selection { border: none !important; }
102
+ }
75
103
  }
76
104
 
77
105
  // Buttons
@@ -139,13 +167,6 @@ ul.dt-button-collection {
139
167
  }
140
168
  }
141
169
 
142
- // Showing 1 to 25 of 100 entries
143
- div.dataTables_wrapper div.dataTables_info {
144
- color: #909090;
145
- font-size: 12px;
146
- padding: 5px 0px 6px 6px;
147
- }
148
-
149
170
  // Collapsed Responsive View
150
171
  table.dataTable > tbody > tr.child {
151
172
  span.dtr-title { min-width: 175px; margin-bottom: 4px; }
@@ -11,7 +11,7 @@ module Effective
11
11
  end
12
12
 
13
13
  def length(length)
14
- raise 'length must be 10, 25, 50, 100, 250, 1000, :all' unless [10, 25, 50, 100, 250, 1000, :all].include?(length)
14
+ raise 'length must be 10, 25, 50, 100, 250, 500, :all' unless [10, 25, 50, 100, 250, 500, :all].include?(length)
15
15
  datatable.state[:length] ||= (length == :all ? 9999999 : length)
16
16
  end
17
17
 
@@ -21,7 +21,7 @@ EffectiveDatatables.setup do |config|
21
21
  config.authorization_method = Proc.new { |controller, action, resource| authorize!(action, resource) } # CanCanCan
22
22
 
23
23
  # Default number of entries shown per page
24
- # Valid options are: 5, 10, 25, 50, 100, 250, 1000, :all
24
+ # Valid options are: 5, 10, 25, 50, 100, 250, 500, :all
25
25
  config.default_length = 25
26
26
 
27
27
  # Default class used on the <table> tag
@@ -1,3 +1,3 @@
1
1
  module EffectiveDatatables
2
- VERSION = '3.3.0'.freeze
2
+ VERSION = '3.3.1'.freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: effective_datatables
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.3.0
4
+ version: 3.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Code and Effect