* Triggered at each scroll handle scroll tick.
()
| 444 | * Triggered at each scroll handle scroll tick. |
| 445 | */ |
| 446 | scrollHandleDidScroll () { |
| 447 | if (this._scrollHandleIndex === null) { |
| 448 | // Stop when scroll handle is no longer active |
| 449 | return |
| 450 | } |
| 451 | |
| 452 | // Calculate intermediate scroll position |
| 453 | const direction = this._scrollHandleIndex === 0 ? -1 : 1 |
| 454 | const duration = (new Date().getTime() - this._scrollHandleStartTime) / 1000 |
| 455 | const delta = direction * Math.pow(duration, 2) * scrollHandleSpeed |
| 456 | this.scrollTo(this._scrollHandleStartPosition + delta) |
| 457 | |
| 458 | window.requestAnimationFrame(this.scrollHandleDidScroll.bind(this)) |
| 459 | } |
| 460 | |
| 461 | /** |
| 462 | * Triggered when scroll handle stops scrolling. |