File tree Expand file tree Collapse file tree 2 files changed +11
-6
lines changed Expand file tree Collapse file tree 2 files changed +11
-6
lines changed Original file line number Diff line number Diff line change 7575
7676 scrollTop = containerCtrl . viewport [ 0 ] . scrollTop ;
7777 // Get the scroll percentage
78- var scrollYPercentage = ( scrollTop + scrollYAmount ) / rowContainer . getVerticalScrollLength ( ) ;
78+ scrollEvent . verticalScrollLength = rowContainer . getVerticalScrollLength ( ) ;
79+ var scrollYPercentage = ( scrollTop + scrollYAmount ) / scrollEvent . verticalScrollLength ;
7980
8081 // Keep scrollPercentage within the range 0-1.
8182 if ( scrollYPercentage < 0 ) { scrollYPercentage = 0 ; }
8889
8990 // Get the scroll percentage
9091 scrollLeft = gridUtil . normalizeScrollLeft ( containerCtrl . viewport , grid ) ;
91- var scrollXPercentage = ( scrollLeft + scrollXAmount ) / ( colContainer . getCanvasWidth ( ) - colContainer . getViewportWidth ( ) ) ;
92+ scrollEvent . horizontalScrollLength = ( colContainer . getCanvasWidth ( ) - colContainer . getViewportWidth ( ) ) ;
93+ var scrollXPercentage = ( scrollLeft + scrollXAmount ) / scrollEvent . horizontalScrollLength ;
9294
9395 // Keep scrollPercentage within the range 0-1.
9496 if ( scrollXPercentage < 0 ) { scrollXPercentage = 0 ; }
Original file line number Diff line number Diff line change 5353 self . x = null ;
5454 self . y = null ;
5555
56+ self . verticalScrollLength = - 9999999 ;
57+ self . horizontalScrollLength = - 999999 ;
58+
5659
5760 /**
5861 * @ngdoc function
132135 } ;
133136
134137 ScrollEvent . prototype . atTop = function ( scrollTop ) {
135- return ( this . y && this . y . percentage === 0 && scrollTop === 0 ) ;
138+ return ( this . y && ( this . y . percentage === 0 || this . verticalScrollLength < 0 ) && scrollTop === 0 ) ;
136139 } ;
137140
138141 ScrollEvent . prototype . atBottom = function ( scrollTop ) {
139- return ( this . y && this . y . percentage === 1 && scrollTop > 0 ) ;
142+ return ( this . y && ( this . y . percentage === 1 || this . verticalScrollLength === 0 ) && scrollTop > 0 ) ;
140143 } ;
141144
142145 ScrollEvent . prototype . atLeft = function ( scrollLeft ) {
143- return ( this . x && this . x . percentage === 0 && scrollLeft === 0 ) ;
146+ return ( this . x && ( this . x . percentage === 0 || this . horizontalScrollLength < 0 ) && scrollLeft === 0 ) ;
144147 } ;
145148
146149 ScrollEvent . prototype . atRight = function ( scrollLeft ) {
147- return ( this . x && this . x . percentage === 1 && scrollLeft > 0 ) ;
150+ return ( this . x && ( this . x . percentage === 1 || this . horizontalScrollLength === 0 ) && scrollLeft > 0 ) ;
148151 } ;
149152
150153
You can’t perform that action at this time.
0 commit comments