add comments

This commit is contained in:
Bruno Windels 2021-09-14 17:01:30 +02:00
parent feb0cf7e39
commit 247d6a2148

View file

@ -101,6 +101,9 @@ export class TimelineView extends TemplateView<TimelineViewModel> {
if (newAnchoredBottom !== this.anchoredBottom) { if (newAnchoredBottom !== this.anchoredBottom) {
const bottomDiff = newAnchoredBottom - this.anchoredBottom; const bottomDiff = newAnchoredBottom - this.anchoredBottom;
console.log(`restore: scroll by ${bottomDiff} as height changed`); console.log(`restore: scroll by ${bottomDiff} as height changed`);
// scrollBy tends to create less scroll jumps than reassigning scrollTop as it does
// not depend on reading scrollTop, which might be out of date as some platforms
// run scrolling off the main thread.
if (typeof timeline.scrollBy === "function") { if (typeof timeline.scrollBy === "function") {
timeline.scrollBy(0, bottomDiff); timeline.scrollBy(0, bottomDiff);
} else { } else {
@ -111,6 +114,8 @@ export class TimelineView extends TemplateView<TimelineViewModel> {
// console.log("restore: bottom didn't change, must be below viewport"); // console.log("restore: bottom didn't change, must be below viewport");
} }
} }
// TODO: should we be updating the visible range here as well as the range might have changed even though
// we restored the bottom tile
} }
} }