mirror of
https://github.com/vector-im/hydrogen-web.git
synced 2024-12-23 03:25:12 +01:00
actually, pass in just the tile instances for expressing the range
This commit is contained in:
parent
b3cd2a0e03
commit
f4b4638ea8
@ -45,8 +45,7 @@ export class TimelineViewModel extends ViewModel {
|
||||
this._timeline.loadAtTop(50);
|
||||
}
|
||||
|
||||
setVisibleTileRange(startId, endId) {
|
||||
console.log("setVisibleTileRange", startId, endId);
|
||||
setVisibleTileRange(startTile, endTile) {
|
||||
}
|
||||
|
||||
get tiles() {
|
||||
|
@ -119,7 +119,6 @@ export class TimelineView extends TemplateView<TimelineViewModel> {
|
||||
const viewportBottom = scrollTop + clientHeight;
|
||||
const anchoredNodeIndex = findFirstNodeIndexAtOrBelow(tiles, viewportBottom);
|
||||
this.anchoredNode = tiles.childNodes[anchoredNodeIndex] as HTMLElement;
|
||||
this.anchoredNode.classList.add("pinned");
|
||||
this.anchoredBottom = bottom(this.anchoredNode!);
|
||||
bottomNodeIndex = anchoredNodeIndex;
|
||||
}
|
||||
@ -131,7 +130,7 @@ export class TimelineView extends TemplateView<TimelineViewModel> {
|
||||
const firstVisibleChild = this.tilesView!.getChildInstanceByIndex(startIndex);
|
||||
const lastVisibleChild = this.tilesView!.getChildInstanceByIndex(endIndex);
|
||||
if (firstVisibleChild && lastVisibleChild) {
|
||||
this.value.setVisibleTileRange(firstVisibleChild.id, lastVisibleChild.id);
|
||||
this.value.setVisibleTileRange(firstVisibleChild.value, lastVisibleChild.value);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -23,7 +23,4 @@ export class AnnouncementView extends TemplateView {
|
||||
|
||||
/* This is called by the parent ListView, which just has 1 listener for the whole list */
|
||||
onClick() {}
|
||||
|
||||
/** Used by TimelineView to get the id of a tile when setting the visible range */
|
||||
get id() { return this.value.id; }
|
||||
}
|
||||
|
@ -86,9 +86,6 @@ export class BaseMessageView extends TemplateView {
|
||||
}
|
||||
}
|
||||
|
||||
/** Used by TimelineView to get the id of a tile when setting the visible range */
|
||||
get id() { return this.value.id; }
|
||||
|
||||
_toggleMenu(button) {
|
||||
if (this._menuPopup && this._menuPopup.isOpen) {
|
||||
this._menuPopup.close();
|
||||
|
@ -32,7 +32,4 @@ export class GapView extends TemplateView {
|
||||
|
||||
/* This is called by the parent ListView, which just has 1 listener for the whole list */
|
||||
onClick() {}
|
||||
|
||||
/** Used by TimelineView to get the id of a tile when setting the visible range */
|
||||
get id() { return this.value.id; }
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user