@@ -2363,18 +2363,13 @@ angular.module('ui.grid')
2363
2363
2364
2364
// We were given a column to scroll to
2365
2365
if ( gridCol !== null ) {
2366
- // This is the index of the row we want to scroll to, within the list of rows that can be visible
2366
+ // This is the index of the column we want to scroll to, within the list of columns that can be visible
2367
2367
var seekColumnIndex = visColCache . indexOf ( gridCol ) ;
2368
2368
2369
- // Total vertical scroll length of the grid
2369
+ // Total horizontal scroll length of the grid
2370
2370
var horizScrollLength = ( self . renderContainers . body . getCanvasWidth ( ) - self . renderContainers . body . getViewportWidth ( ) ) ;
2371
2371
2372
- // Add the height of the native horizontal scrollbar to the scroll length, if it's there. Otherwise it will mask over the final row
2373
- // if (self.verticalScrollbarWidth && self.verticalScrollbarWidth > 0) {
2374
- // horizScrollLength = horizScrollLength + self.verticalScrollbarWidth;
2375
- // }
2376
-
2377
- // This is the minimum amount of pixels we need to scroll vertical in order to see this column
2372
+ // This is the minimum amount of pixels we need to scroll horizontal in order to see this column
2378
2373
var columnLeftEdge = 0 ;
2379
2374
for ( var i = 0 ; i < seekColumnIndex ; i ++ ) {
2380
2375
var col = visColCache [ i ] ;
@@ -2389,9 +2384,9 @@ angular.module('ui.grid')
2389
2384
2390
2385
var horizScrollPixels , horizPercentage ;
2391
2386
2392
- // If the scroll position we need to see the row is LESS than the top boundary, i.e. obscured above the top of the self...
2387
+ // If the scroll position we need to see the column is LESS than the left boundary, i.e. obscured before the left of the self...
2393
2388
if ( columnLeftEdge < leftBound ) {
2394
- // Get the different between the top boundary and the required scroll position and subtract it from the current scroll position\
2389
+ // Get the different between the left boundary and the required scroll position and subtract it from the current scroll position\
2395
2390
// to get the full position we need
2396
2391
horizScrollPixels = self . renderContainers . body . prevScrollLeft - ( leftBound - columnLeftEdge ) ;
2397
2392
@@ -2400,9 +2395,9 @@ angular.module('ui.grid')
2400
2395
horizPercentage = ( horizPercentage > 1 ) ? 1 : horizPercentage ;
2401
2396
scrollEvent . x = { percentage : horizPercentage } ;
2402
2397
}
2403
- // Otherwise if the scroll position we need to see the row is MORE than the bottom boundary, i.e. obscured below the bottom of the self...
2398
+ // Otherwise if the scroll position we need to see the column is MORE than the right boundary, i.e. obscured after the right of the self...
2404
2399
else if ( columnRightEdge > rightBound ) {
2405
- // Get the different between the bottom boundary and the required scroll position and add it to the current scroll position
2400
+ // Get the different between the right boundary and the required scroll position and add it to the current scroll position
2406
2401
// to get the full position we need
2407
2402
horizScrollPixels = columnRightEdge - rightBound + self . renderContainers . body . prevScrollLeft ;
2408
2403
0 commit comments