1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-22 03:03:43 +00:00

Basic proof of concept for cdk-virtual-scroll

This commit is contained in:
Thomas Rittson
2021-05-20 12:35:23 +10:00
parent b827614563
commit 9e5869773d
5 changed files with 84 additions and 29 deletions

View File

@@ -53,8 +53,8 @@
</div>
</div>
</ng-container>
<ng-container *ngIf="(isPaging() ? pagedCiphers : ciphers) as filteredCiphers">
<div class="no-items" *ngIf="!filteredCiphers.length">
<ng-container *ngIf="ciphers">
<div class="no-items" *ngIf="!ciphers.length">
<i class="fa fa-spinner fa-spin fa-3x" *ngIf="!loaded" aria-hidden="true"></i>
<ng-container *ngIf="loaded">
<p>{{'noItemsInList' | i18n}}</p>
@@ -63,15 +63,13 @@
</button>
</ng-container>
</div>
<div class="box list only-list" *ngIf="filteredCiphers.length" infiniteScroll [infiniteScrollDistance]="1"
[infiniteScrollContainer]="'content'" [fromRoot]="true" [infiniteScrollDisabled]="!isPaging()"
(scrolled)="loadMore()">
<div class="box list only-list" *ngIf="ciphers.length">
<div class="box-header">
{{groupingTitle}}
<span class="flex-right">{{isSearching() ? filteredCiphers.length : ciphers.length}}</span>
<span class="flex-right">{{isSearching() ? ciphers.length : ciphers.length}}</span>
</div>
<div class="box-content">
<app-ciphers-list [ciphers]="filteredCiphers" title="{{'viewItem' | i18n}}"
<app-ciphers-list [ciphers]="ciphers" title="{{'viewItem' | i18n}}"
(onSelected)="selectCipher($event)" (launchEvent)="launchCipher($event)"></app-ciphers-list>
</div>
</div>