grasshopper_paginate 0.0.4 → 0.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ab1420d37ccba9363219e50bc9bb502d9bc98001
4
- data.tar.gz: 954404e0f60085f5767c4b991c0f17b4defa988b
3
+ metadata.gz: daf40d062b419ed185c7ccd36ecc02a2c31a26e4
4
+ data.tar.gz: efb851d120bc3031bd405d984ec71786ac96c401
5
5
  SHA512:
6
- metadata.gz: 85c1aeb29f812a3b48a0dba3e8c7ea5dc81d8eaec4b4c770c9a18abd006cc1741be52ed763ee0bfb6cf73aa1337fc525b2c6e9da5888db4225ac890dc8f5ce43
7
- data.tar.gz: 680222046924dbd32036fcbf24b349f64bc823f22956cc751a6f122b79a55c1e8f324276c6c32a2f695ba2a5ee24667aab6b3ef1bbebabf8b3a950a9341344d1
6
+ metadata.gz: 94ffcf86cdfaf008f46c4ee951b6fc3830a77f60bc9b0928102d4cf57db027e1119b5ac55cd02d66f3281267b53560ac36bb3061f35f52026f991ceaa41c6ca4
7
+ data.tar.gz: 2667520d751bb5afe776e7ab178cf2b9c5fad8992c2831b77958ad75e60c601f3769f9925ca86c9c0246321ef5e0711d9d3a30e55e5141fea5b44235fcbdda43
@@ -16,3 +16,4 @@ $ ->
16
16
  newUrl = url.replace 'page_number', newPage
17
17
  hiddenLink.attr 'href', newUrl
18
18
  hiddenLink.click()
19
+ window.location.href = newUrl unless goto.hasClass('ajax')
@@ -1,8 +1,8 @@
1
1
  module Grasshopper
2
2
  module Paginate
3
3
  module Helper
4
- def grasshopper_paginate(pages)
5
- will_paginate pages, default_options
4
+ def grasshopper_paginate(pages, options={})
5
+ will_paginate pages, options.merge(default_options)
6
6
  end
7
7
 
8
8
  private
@@ -26,7 +26,9 @@ module Grasshopper
26
26
  private
27
27
 
28
28
  def goto_input
29
- tag :ul, page_input, class: 'pagination goto hide'
29
+ class_list = 'pagination goto hide'
30
+ class_list += ' ajax' if @options[:ajax]
31
+ tag :ul, page_input, class: class_list
30
32
  end
31
33
 
32
34
  def page_input
@@ -1,5 +1,5 @@
1
1
  module Grasshopper
2
2
  module Paginate
3
- VERSION = "0.0.4"
3
+ VERSION = "0.0.5"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: grasshopper_paginate
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - JIEXIN HUANG