forked from mystiq/hydrogen-web
restore bottom of timeline initially after attach to DOM
this will also load more items if the viewport isn't filled
This commit is contained in:
parent
e89f60bac0
commit
ab67ac00b1
1 changed files with 5 additions and 0 deletions
|
@ -71,6 +71,11 @@ export class TimelineView extends TemplateView<TimelineViewModel> {
|
||||||
private tilesView?: TilesListView;
|
private tilesView?: TilesListView;
|
||||||
|
|
||||||
render(t: TemplateBuilder, vm: TimelineViewModel) {
|
render(t: TemplateBuilder, vm: TimelineViewModel) {
|
||||||
|
// assume this view will be mounted in the parent DOM straight away
|
||||||
|
requestAnimationFrame(() => {
|
||||||
|
// do initial scroll positioning
|
||||||
|
this.restoreScrollPosition();
|
||||||
|
});
|
||||||
this.tilesView = new TilesListView(vm.tiles, () => this.restoreScrollPosition());
|
this.tilesView = new TilesListView(vm.tiles, () => this.restoreScrollPosition());
|
||||||
return t.div({className: "Timeline bottom-aligned-scroll", onScroll: () => this.onScroll()}, [
|
return t.div({className: "Timeline bottom-aligned-scroll", onScroll: () => this.onScroll()}, [
|
||||||
t.view(this.tilesView)
|
t.view(this.tilesView)
|
||||||
|
|
Loading…
Reference in a new issue