diff --git a/src/platform/web/ui/general/LazyListView.js b/src/platform/web/ui/general/LazyListView.js index 4426d97c..9e1bdfc0 100644 --- a/src/platform/web/ui/general/LazyListView.js +++ b/src/platform/web/ui/general/LazyListView.js @@ -72,11 +72,12 @@ class ItemRange { } export class LazyListView extends ListView { - constructor({itemHeight, overflowMargin = 5, overflowItems = 20,...options}, childCreator) { + constructor({itemHeight, onRangeVisible, overflowMargin = 5, overflowItems = 20,...options}, childCreator) { super(options, childCreator); this._itemHeight = itemHeight; this._overflowMargin = overflowMargin; this._overflowItems = overflowItems; + this._onRangeVisible = onRangeVisible; // function(ItemRange) } _getVisibleRange() { @@ -103,6 +104,9 @@ export class LazyListView extends ListView { if (forceRender || !this._renderRange.contains(intersectRange)) { this._renderRange = renderRange; this._renderElementsInRange(); + if (this._onRangeVisible) { + this._onRangeVisible(renderRange); + } } } diff --git a/src/platform/web/ui/session/leftpanel/LeftPanelView.js b/src/platform/web/ui/session/leftpanel/LeftPanelView.js index b6f7a8db..a75207ee 100644 --- a/src/platform/web/ui/session/leftpanel/LeftPanelView.js +++ b/src/platform/web/ui/session/leftpanel/LeftPanelView.js @@ -64,6 +64,9 @@ export class LeftPanelView extends TemplateView { className: "RoomList", itemHeight: 44, list: vm.tileViewModels, + onRangeVisible: (range) => { + console.log(range); + }, }, tileVM => { if (tileVM.kind === "invite") {