corn_starch 1.3.12 → 1.3.13

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: a5fde93c833724e8c8a589f6a5690c65deaaa5aa
4
- data.tar.gz: 2551d3a504e747318e6b2a97b5684246f8700a68
3
+ metadata.gz: 311eca2090900ddf87c7dbafa327fdc480398f42
4
+ data.tar.gz: fba5243883160115ea5d0fc213e61ad0b8801b68
5
5
  SHA512:
6
- metadata.gz: ebe73f80998d95c556933bab0ec7a459426d614dba7ff032451c1d17342838cc6f7c30f91a386ef67d16b585c8cbde3407e02188271caddc1892293d94bffdf2
7
- data.tar.gz: 79e99f5753c7bceb984895f6485570318a833a12145cd6a03cd67810e8dd25ab389f463f6ee9e6855d82bfef8f55dcb03e695a5acf86dc71cc08bee1cd5cbe68
6
+ metadata.gz: 239d817cc6b9e3c9f05d32340719540b6ace66dfefa32202b7ecfa1e743185f8497b8740629034d466d6d11d70c4e2e5be5b23a8197e79e770283d882c5af439
7
+ data.tar.gz: 85f77d39197cbd51c1431848879f4256e255f8cdec21bd158b9d2e302fe3d1a9b922ff4e5f02b106abc7a5ccae5f4f03f81f56ee09b1486ec74c1f963a166c1a
@@ -3,6 +3,24 @@
3
3
 
4
4
  # InfiniScroll JS
5
5
 
6
+ # Initialize InfiniScroll for the Page
7
+ $ ->
8
+
9
+ # Acquire Container
10
+ infiniscroll_container = $('.infiniscroll-container')
11
+
12
+ # Handle Scroll Events
13
+ $(window).scroll ->
14
+
15
+ # Check Position
16
+ if ($(window).scrollTop() + $(window).height()) >= ($(document).height() - infiniscroll_container.attr('infiniscroll-margin'))
17
+
18
+ # DEBUG
19
+ alert('InfiniScroll Container : ' + infiniscroll_container.id)
20
+
21
+ # Scroll it, bitch !
22
+ infiniscroll infiniscroll_container.id
23
+
6
24
  # InfiniScroll
7
25
  window.infiniscroll = (container) ->
8
26
 
@@ -27,7 +27,7 @@ module CornStarch
27
27
  end
28
28
 
29
29
  # Produce Container
30
- div_tag id: id, 'infiniscroll-trgt' => target, 'infiniscroll-args' => args, 'infiniscroll-next' => n, &block
30
+ div_tag id: id, 'infiniscroll-trgt' => target, 'infiniscroll-args' => args, 'infiniscroll-next' => n, 'infiniscroll-margin' => CORNSTARCH_CONF[:infiniscroll][:margin], &block
31
31
  end
32
32
  end
33
33
  end
@@ -25,6 +25,10 @@ CORNSTARCH_CONF[:pagination][:records_per_page] ||= {}
25
25
  CORNSTARCH_CONF[:pagination][:records_per_page][:default] ||= 10
26
26
  CORNSTARCH_CONF[:pagination][:records_per_page][:opts] ||= [ 10, 25, 50, 100 ]
27
27
 
28
+ # InfiniScroll
29
+ CORNSTARCH_CONF[:infiniscroll] ||= {}
30
+ CORNSTARCH_CONF[:infiniscroll][:margin] = 300
31
+
28
32
  # Authentication
29
33
  CORNSTARCH_CONF[:authentication] ||= {}
30
34
  CORNSTARCH_CONF[:authentication][:user_model] ||= {}
@@ -1,3 +1,3 @@
1
1
  module CornStarch
2
- VERSION = '1.3.12'
2
+ VERSION = '1.3.13'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: corn_starch
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.12
4
+ version: 1.3.13
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eresse