1
- /* ng-infinite-scroll - v1.2.0 - 2015-02-14 */
1
+ /* ng-infinite-scroll - v1.2.0 - 2015-12-02 */
2
2
var mod ;
3
3
4
4
mod = angular . module ( 'infinite-scroll' , [ ] ) ;
@@ -17,7 +17,7 @@ mod.directive('infiniteScroll', [
17
17
infiniteScrollListenForEvent : '@'
18
18
} ,
19
19
link : function ( scope , elem , attrs ) {
20
- var changeContainer , checkWhenEnabled , container , handleInfiniteScrollContainer , handleInfiniteScrollDisabled , handleInfiniteScrollDistance , handleInfiniteScrollUseDocumentBottom , handler , height , immediateCheck , offsetTop , pageYOffset , scrollDistance , scrollEnabled , throttle , unregisterEventListener , useDocumentBottom , windowElement ;
20
+ var changeContainer , checkInterval , checkWhenEnabled , container , handleInfiniteScrollContainer , handleInfiniteScrollDisabled , handleInfiniteScrollDistance , handleInfiniteScrollUseDocumentBottom , handler , height , immediateCheck , offsetTop , pageYOffset , scrollDistance , scrollEnabled , throttle , unregisterEventListener , useDocumentBottom , windowElement ;
21
21
windowElement = angular . element ( $window ) ;
22
22
scrollDistance = null ;
23
23
scrollEnabled = null ;
@@ -26,6 +26,7 @@ mod.directive('infiniteScroll', [
26
26
immediateCheck = true ;
27
27
useDocumentBottom = false ;
28
28
unregisterEventListener = null ;
29
+ checkInterval = false ;
29
30
height = function ( elem ) {
30
31
elem = elem [ 0 ] || elem ;
31
32
if ( isNaN ( elem . offsetHeight ) ) {
@@ -76,6 +77,9 @@ mod.directive('infiniteScroll', [
76
77
}
77
78
}
78
79
} else {
80
+ if ( checkInterval ) {
81
+ $interval . cancel ( checkInterval ) ;
82
+ }
79
83
return checkWhenEnabled = false ;
80
84
}
81
85
} ;
@@ -175,11 +179,11 @@ mod.directive('infiniteScroll', [
175
179
if ( attrs . infiniteScrollImmediateCheck != null ) {
176
180
immediateCheck = scope . $eval ( attrs . infiniteScrollImmediateCheck ) ;
177
181
}
178
- return $interval ( ( function ( ) {
182
+ return checkInterval = $interval ( ( function ( ) {
179
183
if ( immediateCheck ) {
180
184
return handler ( ) ;
181
185
}
182
- } ) , 0 , 1 ) ;
186
+ } ) , 0 ) ;
183
187
}
184
188
} ;
185
189
}
0 commit comments