pagy 1.3 → 1.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
  SHA256:
3
- metadata.gz: b17506ef8c1eb28b4d309d528129738e50df21e8133a5a5b93b513770bd166df
4
- data.tar.gz: 2083ac8f294973bb99fa458bb97ca70894b07299bf430ccb0e30739a08b72b98
3
+ metadata.gz: ded274d1b6929671f79ae2dea4eed1203241a2a5178aa747c39e3ea3d0b86c7a
4
+ data.tar.gz: 85d3ab91e16da33221568d4d075a9e95040c6739d810558287d19b24bc311169
5
5
  SHA512:
6
- metadata.gz: 23b98cd8d721407c821f32305c8acff47ced168eead12030fa54b5547323a444afb524e834e4ab2417aaebac593e832e6fd93df64045164b6f31d90aa2a0fd8e
7
- data.tar.gz: 1d66cffcb0396a788db7f2fbf2818e7d440e3f6530bb8e50262d07b888e5ad1be5cc717e3f97da0750172c27248bfd33b465452e20331e241b4fb57617cf135b
6
+ metadata.gz: 84f75a95a68c73ebf85052ea9c21300c249928d5450ff01cb46ae1919d60276b77bb2f73eb6b36f243eac7522406c7837aeaca66983dedb0866b3b6a9dde549e
7
+ data.tar.gz: 99cf22a77850bc49431c8656ec7c95f218049f00e8cd21862692f32c2516e9bd1f4a827b73804ad66f3ed1f9640a77c5c823b276a4662c804bb507d67fd60484
data/lib/pagy.rb CHANGED
@@ -3,7 +3,7 @@
3
3
 
4
4
  require 'pathname'
5
5
 
6
- class Pagy ; VERSION = '1.3'
6
+ class Pagy ; VERSION = '1.3.1'
7
7
 
8
8
  class OverflowError < StandardError; attr_reader :pagy; def initialize(pagy) @pagy = pagy end; end
9
9
 
@@ -47,10 +47,11 @@ class Pagy
47
47
 
48
48
  # Return the items selector HTML. For example "Show [20] items per page"
49
49
  def pagy_items_selector(pagy, id=pagy_id)
50
- pagy = pagy.clone; p_vars = pagy.vars; p_items = p_vars[:items]; p_vars[:items] = "#{MARKER}-items-"
50
+ p_vars = pagy.vars; p_items = p_vars[:items]; p_vars[:items] = "#{MARKER}-items-"
51
51
 
52
52
  html = +%(<span id="#{id}">)
53
53
  html << %(<a href="#{pagy_url_for("#{MARKER}-page-", pagy)}"></a>)
54
+ p_vars[:items] = p_items # restore the items
54
55
  input = %(<input type="number" min="1" max="#{p_vars[:max_items]}" value="#{p_items}" style="padding: 0; text-align: center; width: #{p_items.to_s.length+1}rem;">)
55
56
  html << %(#{pagy_t('pagy.items', items_input: input, count: p_items)})
56
57
  html << %(</span>#{pagy_json_tag(:items, id, MARKER, pagy.from)})
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: '1.3'
4
+ version: 1.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Domizio Demichelis
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-01-15 00:00:00.000000000 Z
11
+ date: 2019-01-22 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,