Skip to content

Commit efa06e0

Browse files
committed
Fixes sroze#26: immediate-check required more that once
1 parent 1fdf9e7 commit efa06e0

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

src/infinite-scroll.coffee

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,14 +38,17 @@ mod.directive 'infiniteScroll', ['$rootScope', '$window', '$timeout', 'THROTTLE_
3838
remaining = elementBottom - containerBottom
3939
shouldScroll = remaining <= container.height() * scrollDistance + 1
4040

41-
if shouldScroll && scrollEnabled
42-
if scope.$$phase || $rootScope.$$phase
43-
scope.infiniteScroll()
44-
else
45-
scope.$apply(scope.infiniteScroll)
46-
else if shouldScroll
41+
if shouldScroll
4742
checkWhenEnabled = true
4843

44+
if scrollEnabled
45+
if scope.$$phase || $rootScope.$$phase
46+
scope.infiniteScroll()
47+
else
48+
scope.$apply(scope.infiniteScroll)
49+
else
50+
checkWhenEnabled = false
51+
4952
# The optional THROTTLE_MILLISECONDS configuration value specifies
5053
# a minimum time that should elapse between each call to the
5154
# handler. N.b. the first call the handler will be run

0 commit comments

Comments
 (0)