1- /* ng-infinite-scroll - v1.2.0 - 2015-02-14 */
1+ /* ng-infinite-scroll - v1.2.0 - 2015-12-02 */
22var mod ;
33
44mod = angular . module ( 'infinite-scroll' , [ ] ) ;
@@ -17,7 +17,7 @@ mod.directive('infiniteScroll', [
1717 infiniteScrollListenForEvent : '@'
1818 } ,
1919 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 ;
2121 windowElement = angular . element ( $window ) ;
2222 scrollDistance = null ;
2323 scrollEnabled = null ;
@@ -26,6 +26,7 @@ mod.directive('infiniteScroll', [
2626 immediateCheck = true ;
2727 useDocumentBottom = false ;
2828 unregisterEventListener = null ;
29+ checkInterval = false ;
2930 height = function ( elem ) {
3031 elem = elem [ 0 ] || elem ;
3132 if ( isNaN ( elem . offsetHeight ) ) {
@@ -76,6 +77,9 @@ mod.directive('infiniteScroll', [
7677 }
7778 }
7879 } else {
80+ if ( checkInterval ) {
81+ $interval . cancel ( checkInterval ) ;
82+ }
7983 return checkWhenEnabled = false ;
8084 }
8185 } ;
@@ -175,11 +179,11 @@ mod.directive('infiniteScroll', [
175179 if ( attrs . infiniteScrollImmediateCheck != null ) {
176180 immediateCheck = scope . $eval ( attrs . infiniteScrollImmediateCheck ) ;
177181 }
178- return $interval ( ( function ( ) {
182+ return checkInterval = $interval ( ( function ( ) {
179183 if ( immediateCheck ) {
180184 return handler ( ) ;
181185 }
182- } ) , 0 , 1 ) ;
186+ } ) , 0 ) ;
183187 }
184188 } ;
185189 }
0 commit comments