@@ -44,7 +44,7 @@ export class StickyStyler {
44
44
* @param stickyDirections The directions that should no longer be set as sticky on the rows.
45
45
*/
46
46
clearStickyPositioning ( rows : HTMLElement [ ] , stickyDirections : StickyDirection [ ] ) {
47
- for ( let row of rows ) {
47
+ for ( const row of rows ) {
48
48
this . _removeStickyStyle ( row , stickyDirections ) ;
49
49
for ( let i = 0 ; i < row . children . length ; i ++ ) {
50
50
const cell = row . children [ i ] as HTMLElement ;
@@ -70,13 +70,15 @@ export class StickyStyler {
70
70
return ;
71
71
}
72
72
73
- const numCells = rows [ 0 ] . children . length ;
74
- const cellWidths : number [ ] = this . _getCellWidths ( rows [ 0 ] ) ;
73
+ const firstRow = rows [ 0 ] ;
74
+ const numCells = firstRow . children . length ;
75
+ const cellWidths : number [ ] = this . _getCellWidths ( firstRow ) ;
76
+
75
77
const startPositions = this . _getStickyStartColumnPositions ( cellWidths , stickyStartStates ) ;
76
78
const endPositions = this . _getStickyEndColumnPositions ( cellWidths , stickyEndStates ) ;
77
79
const isRtl = this . direction === 'rtl' ;
78
80
79
- for ( let row of rows ) {
81
+ for ( const row of rows ) {
80
82
for ( let i = 0 ; i < numCells ; i ++ ) {
81
83
const cell = row . children [ i ] as HTMLElement ;
82
84
if ( stickyStartStates [ i ] ) {
@@ -153,7 +155,7 @@ export class StickyStyler {
153
155
* sticky position if there are no more directions.
154
156
*/
155
157
_removeStickyStyle ( element : HTMLElement , stickyDirections : StickyDirection [ ] ) {
156
- for ( let dir of stickyDirections ) {
158
+ for ( const dir of stickyDirections ) {
157
159
element . style [ dir ] = '' ;
158
160
}
159
161
element . style . zIndex = this . _getCalculatedZIndex ( element ) ;
@@ -199,7 +201,7 @@ export class StickyStyler {
199
201
} ;
200
202
201
203
let zIndex = 0 ;
202
- for ( let dir of STICKY_DIRECTIONS ) {
204
+ for ( const dir of STICKY_DIRECTIONS ) {
203
205
if ( element . style [ dir ] ) {
204
206
zIndex += zIndexIncrements [ dir ] ;
205
207
}
0 commit comments