corn_starch 1.3.21 → 1.3.22
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/javascripts/corn_starch/infiniscroll.js.coffee +20 -12
- data/lib/corn_starch/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b1ddcc9d90966e22137a94f79ee3d196f030348b
|
4
|
+
data.tar.gz: d310a7d78aa2bef25bf2f7e8fe666377e2f873cb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 48b45125ca996daece6e3bb89778c11f16e0a066e9b981cf544d4763d59a8e577921f1ae3577fdeed87ed746402999e8846ffa04fc750f97d9f32499b43aa15b
|
7
|
+
data.tar.gz: b4329065707e276a2366ec85e3b7ec5383e744bc2b99bd14c6418cc95081eb6027f978c7990a0c3b1831f69a6703089bf2e2a3babc77c9f0abd1137fdb3a2814
|
@@ -14,13 +14,24 @@ $ ->
|
|
14
14
|
infiniscroll_container = infiniscroll_container[0]
|
15
15
|
|
16
16
|
# Handle Scroll Events
|
17
|
-
$(window).scroll
|
17
|
+
$(window).scroll infiniscroll_handler
|
18
18
|
|
19
|
-
|
20
|
-
|
19
|
+
# Scroll Handler
|
20
|
+
window.infiniscroll_handler = () ->
|
21
21
|
|
22
|
-
|
23
|
-
|
22
|
+
# Acquire Container
|
23
|
+
infiniscroll_container = $('.infiniscroll-container')[0]
|
24
|
+
|
25
|
+
# Check Position
|
26
|
+
if ($(window).scrollTop() + $(window).height()) >= ($(document).height() - infiniscroll_container.getAttribute('infiniscroll-margin'))
|
27
|
+
|
28
|
+
# DEBUG
|
29
|
+
$(window).unbind('scroll')
|
30
|
+
|
31
|
+
alert('foobar')
|
32
|
+
|
33
|
+
# Scroll it, bitch !
|
34
|
+
infiniscroll infiniscroll_container.id
|
24
35
|
|
25
36
|
# InfiniScroll
|
26
37
|
window.infiniscroll = (container) ->
|
@@ -34,13 +45,7 @@ window.infiniscroll = (container) ->
|
|
34
45
|
next = c.attr 'infiniscroll-next'
|
35
46
|
|
36
47
|
# Check End
|
37
|
-
if next == 'none'
|
38
|
-
|
39
|
-
# Drop InfiniScroll
|
40
|
-
$(window).unbind('scroll')
|
41
|
-
|
42
|
-
# Done
|
43
|
-
return
|
48
|
+
return if next == 'none'
|
44
49
|
|
45
50
|
# Construct Args
|
46
51
|
if args == ''
|
@@ -60,3 +65,6 @@ window.infiniscroll = (container) ->
|
|
60
65
|
|
61
66
|
# Append Content
|
62
67
|
$("##{container}").append data['content']
|
68
|
+
|
69
|
+
# Re-Attach Scroll Handler
|
70
|
+
$(window).scroll infiniscroll_handler
|
data/lib/corn_starch/version.rb
CHANGED