pagy 4.10.1 → 4.10.2

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: dfababb2b5f9594ebcf7827cde7c45e9073ba9a270ddca251714e0d8fa1ef711
4
- data.tar.gz: b20c84d4099a7302d6324fa671001051275d01d363eff5b6007d4240b1700d8a
3
+ metadata.gz: af9dd0bcf50c1a54209d29f8a13318fc72f0cb76f07a1ff4e5df04c42e2a0712
4
+ data.tar.gz: 16ec5ce47444e7ef5adc3a3db977dbdf9a518cbec5da0e3d0454c1e33433faae
5
5
  SHA512:
6
- metadata.gz: ba6eadeb0285c6dcf1ae98dfe58fe8844916f3d517813fbc8add6b5b0e0d3933234e26eb15c9fa931c7fccd256844df26d72694f23a3596fa874c3288a4fd4aa
7
- data.tar.gz: 35d1b022f3d4c85521e69b960be16812c5ffe276e1a015e6fa9ce1630f1abf05486908568585dcd0257fee4d2fb304fe6296839404a9091e54a3c6fa10d0068b
6
+ metadata.gz: eb9bcf0b26ef773511e98ab5985a9ce0b4639e79deb60ca2a45ed79cbf6beca5145e032d30907cd4453085a6f2b8072580c4ec4fabd8a788c61037d243e51dc0
7
+ data.tar.gz: 2219496ad2c296a6fe3a93b7380696b29b7c77e16a6b4731d5322aa9df4be0bbf3433355f8780122be72c3149242d52afb617328d14c53522ec1b2f697b39323
data/lib/config/pagy.rb CHANGED
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- # Pagy initializer file (4.10.1)
3
+ # Pagy initializer file (4.10.2)
4
4
  # Customize only what you really need and notice that Pagy works also without any of the following lines.
5
5
  # Should you just cherry pick part of this file, please maintain the require-order of the extras
6
6
 
@@ -56,6 +56,9 @@
56
56
  # also the elasticsearch_rails extra that defines the same
57
57
  # VARS[:searchkick_search_method] = :pagy_search
58
58
  # require 'pagy/extras/searchkick'
59
+ # uncomment if you are going to use Searchkick.pagy_search
60
+ # Searchkick.extend Pagy::Searchkick
61
+
59
62
 
60
63
  # Frontend Extras
61
64
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  function Pagy(){}
4
4
 
5
- Pagy.version = '4.10.1'
5
+ Pagy.version = '4.10.2'
6
6
 
7
7
  Pagy.delay = 100
8
8
 
@@ -114,4 +114,8 @@ Pagy.waitForMe =
114
114
  Pagy.tid = setTimeout(Pagy.renderNavs, Pagy.delay)
115
115
  }
116
116
 
117
- window.addEventListener('resize', Pagy.waitForMe, true)
117
+
118
+ if (typeof window !== "undefined") {
119
+ window.addEventListener('resize', Pagy.waitForMe, true)
120
+ }
121
+
data/lib/pagy.rb CHANGED
@@ -5,7 +5,7 @@ require 'pathname'
5
5
 
6
6
  # main class
7
7
  class Pagy
8
- VERSION = '4.10.1'
8
+ VERSION = '4.10.2'
9
9
 
10
10
  # Root pathname to get the path of Pagy files like templates or dictionaries
11
11
  def self.root
@@ -14,10 +14,14 @@ class Pagy
14
14
  lambda do |num, text=num, extra=''|
15
15
  link = +link_proc.call(num, text, extra)
16
16
  return link unless num == 1
17
- link.sub!(/[?&]#{pagy.vars[:page_param]}=1\b(?!&)|\b#{pagy.vars[:page_param]}=1&/, '')
17
+ pagy_trim(pagy, link)
18
18
  end
19
19
  end
20
20
 
21
+ def pagy_trim(pagy, link)
22
+ link.sub!(/[?&]#{pagy.vars[:page_param]}=1\b(?!&)|\b#{pagy.vars[:page_param]}=1&/, '')
23
+ end
24
+
21
25
  end
22
26
  Frontend.prepend UseTrimExtra
23
27
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pagy
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.10.1
4
+ version: 4.10.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Domizio Demichelis
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-06-24 00:00:00.000000000 Z
11
+ date: 2021-08-18 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: 'Agnostic pagination in plain ruby: it works with any framework, ORM
14
14
  and DB type, with all kinds of collections, even pre-paginated, scopes, Arrays,
@@ -119,7 +119,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
119
119
  - !ruby/object:Gem::Version
120
120
  version: '0'
121
121
  requirements: []
122
- rubygems_version: 3.2.15
122
+ rubygems_version: 3.2.3
123
123
  signing_key:
124
124
  specification_version: 4
125
125
  summary: The Ultimate Pagination Ruby Gem