File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -303,6 +303,10 @@ angular.module('ui.grid')
303
303
return this . getCanvasHeight ( ) - this . getViewportHeight ( ) + this . grid . scrollbarHeight ;
304
304
} ;
305
305
306
+ GridRenderContainer . prototype . getHorizontalScrollLength = function getHorizontalScrollLength ( ) {
307
+ return this . getCanvasWidth ( ) - this . getViewportWidth ( ) + this . grid . scrollbarWidth ;
308
+ } ;
309
+
306
310
GridRenderContainer . prototype . getCanvasWidth = function getCanvasWidth ( ) {
307
311
var self = this ;
308
312
@@ -375,7 +379,7 @@ angular.module('ui.grid')
375
379
if ( xDiff > 0 ) { this . grid . scrollDirection = uiGridConstants . scrollDirection . RIGHT ; }
376
380
if ( xDiff < 0 ) { this . grid . scrollDirection = uiGridConstants . scrollDirection . LEFT ; }
377
381
378
- var horizScrollLength = ( this . canvasWidth - this . getViewportWidth ( ) ) ;
382
+ var horizScrollLength = this . getHorizontalScrollLength ( ) ;
379
383
if ( horizScrollLength !== 0 ) {
380
384
horizScrollPercentage = newScrollLeft / horizScrollLength ;
381
385
}
@@ -487,8 +491,7 @@ angular.module('ui.grid')
487
491
488
492
// Calculate the scroll percentage according to the scrollLeft location, if no percentage was provided
489
493
if ( ( typeof ( scrollPercentage ) === 'undefined' || scrollPercentage === null ) && scrollLeft ) {
490
- var horizScrollLength = ( self . getCanvasWidth ( ) - self . getViewportWidth ( ) ) ;
491
- scrollPercentage = scrollLeft / horizScrollLength ;
494
+ scrollPercentage = scrollLeft / self . getHorizontalScrollLength ( ) ;
492
495
}
493
496
494
497
var colIndex = Math . ceil ( Math . min ( maxColumnIndex , maxColumnIndex * scrollPercentage ) ) ;
You can’t perform that action at this time.
0 commit comments