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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 311eca2090900ddf87c7dbafa327fdc480398f42
|
4
|
+
data.tar.gz: fba5243883160115ea5d0fc213e61ad0b8801b68
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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] ||= {}
|
data/lib/corn_starch/version.rb
CHANGED