Skip to content

Commit a5dd98c

Browse files
[UXP-34] add loading jumping on not loaded page
1 parent f5a537b commit a5dd98c

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

src/app/shared/carousel/carousel.component.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,6 @@ export class CarouselComponent implements OnInit {
9797
*/
9898
carouselItems$: BehaviorSubject<ItemSearchResult[]> = new BehaviorSubject<ItemSearchResult[]>([]);
9999

100-
101100
private paginationOptionId: string;
102101

103102
private pageSize = 5;
@@ -168,6 +167,10 @@ export class CarouselComponent implements OnInit {
168167

169168
if (!this.pageToBitstreamsMap.get(currentPage + 1) && currentSlideIndex + this.slideLoadingBuffer === currentPage * this.pageSize) {
170169
this.loadNextPageBitstreams();
170+
} else if (slideEvent.source === 'indicator' && currentSlideIndex > this.pageSize * this.currentSliderPage) {
171+
this.isLoading$.next(true);
172+
this.currentSliderPage = currentPage;
173+
this.loadNextPageBitstreams();
171174
}
172175
}
173176

@@ -257,6 +260,7 @@ export class CarouselComponent implements OnInit {
257260
if (isNotEmpty(itemToImageHrefMap)) {
258261
this.itemToImageHrefMap$.next(new Map([...Array.from(this.itemToImageHrefMap$.value.entries()), ...Array.from(itemToImageHrefMap.entries())]));
259262
}
263+
this.isLoading$.next(false);
260264
}));
261265

262266
}

0 commit comments

Comments
 (0)