* Adds the sticky styling to the element by adding the sticky style class, changing position * to be sticky (and -webkit-sticky), setting the appropriate zIndex, and adding a sticky * direction and value.
(
element: HTMLElement,
dir: StickyDirection,
dirValue: number,
isBorderElement: boolean,
)
| 383 | * direction and value. |
| 384 | */ |
| 385 | _addStickyStyle( |
| 386 | element: HTMLElement, |
| 387 | dir: StickyDirection, |
| 388 | dirValue: number, |
| 389 | isBorderElement: boolean, |
| 390 | ) { |
| 391 | element.classList.add(this._stickCellCss); |
| 392 | if (isBorderElement) { |
| 393 | element.classList.add(this._borderCellCss[dir]); |
| 394 | } |
| 395 | element.style[dir] = `${dirValue}px`; |
| 396 | element.style.zIndex = this._getCalculatedZIndex(element); |
| 397 | if (this._needsPositionStickyOnElement) { |
| 398 | element.style.cssText += 'position: -webkit-sticky; position: sticky; '; |
| 399 | } |
| 400 | } |
| 401 | |
| 402 | /** |
| 403 | * Calculate what the z-index should be for the element, depending on what directions (top, |
no test coverage detected