effective_datatables 4.3.16 → 4.3.17

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: c1e0d736530c49db08a1225fbd9b22fb81835954
4
- data.tar.gz: fb32aada4f2a0d1f1e7b9eee2e3ec5e5df83b84a
3
+ metadata.gz: 9a71526dc695be3d7a23fbe5d5d680af3615483c
4
+ data.tar.gz: 1dccc6fa3ce885dcc71dc38f3816041f92c373e3
5
5
  SHA512:
6
- metadata.gz: 6e332db2d3c60d61b588ce33928a251f4f6841907f6dad4429cb6b818e0f996ebb8864e51742e389989643ee1c6d78875d5776d736f58d1e7ad147b184b9d835
7
- data.tar.gz: 8066adcb2185255489a045f6cfbfc69ff87b5f172b9914dc2692ee4b00ec9b3ffae35fcc240bc14a9964c449b9d365a780cc8ed301d4c87c712a8af61182404f
6
+ metadata.gz: 303816aba687d20a8dd97654ee23702ab88f2ceb6896aa0afcc4dde96987c7f14ba9f2a3c910218d63af46063d1069186b9e5063ecaf808f6d52bb690c69b82a
7
+ data.tar.gz: 01278ac4c70973772e38f332feb57e92f2dc882e2e654feae1b585dbc09e4905d2b3aeffde70ab4557da1f9ac9e84f6528585e9e294a080d56032bb35e6447e3
@@ -91,7 +91,7 @@ module Effective
91
91
  if datatables_ajax_request?
92
92
  load_filter_params!
93
93
  load_ajax_state!
94
- elsif cookie.present? && cookie[:params] == params.length
94
+ elsif cookie.present? && cookie[:params] == params.length && EffectiveDatatables.save_state
95
95
  load_cookie_state!
96
96
  else
97
97
  # Nothing to do for default state
@@ -31,6 +31,11 @@ EffectiveDatatables.setup do |config|
31
31
  # Log search/sort information to the console
32
32
  config.debug = true
33
33
 
34
- config.max_cookie_size = 2000 # String size. Final byte size is about 1.5 times bigger, after rails signs it
34
+ # If a user has previously visited this page and is returning, use the cookie to restore last session
35
+ # Irregardless of this setting, effective_datatables still uses a cookie to function
36
+ config.save_state = true
37
+
38
+ # String size. Final byte size is about 1.5 times bigger, after rails signs it
39
+ config.max_cookie_size = 2000
35
40
 
36
41
  end
@@ -8,6 +8,7 @@ module EffectiveDatatables
8
8
 
9
9
  mattr_accessor :default_length
10
10
  mattr_accessor :html_class
11
+ mattr_accessor :save_state
11
12
  mattr_accessor :max_cookie_size
12
13
 
13
14
  mattr_accessor :debug
@@ -1,3 +1,3 @@
1
1
  module EffectiveDatatables
2
- VERSION = '4.3.16'.freeze
2
+ VERSION = '4.3.17'.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: 4.3.16
4
+ version: 4.3.17
5
5
  platform: ruby
6
6
  authors:
7
7
  - Code and Effect