Method
update
(
scrollOffset: number,
containerSize: number,
pageSize: number,
)
Source from the content-addressed store, hash-verified
| 41 | } |
| 42 | |
| 43 | update( |
| 44 | scrollOffset: number, |
| 45 | containerSize: number, |
| 46 | pageSize: number, |
| 47 | ) { |
| 48 | // calculate thumb size |
| 49 | // pageSize > containerSize -> scrollable |
| 50 | this.realSize = Math.min(containerSize / pageSize, 1) * containerSize; |
| 51 | this.displaySize = Math.max(this.realSize, this._minSize); |
| 52 | |
| 53 | // calculate thumb offset |
| 54 | this.offset = scrollOffset / pageSize * (containerSize + (this.realSize - this.displaySize)); |
| 55 | |
| 56 | setStyle(this.element, this._getStyle()); |
| 57 | } |
| 58 | |
| 59 | private _getStyle() { |
| 60 | switch (this._direction) { |
Callers
nothing calls this directly
Tested by
no test coverage detected