1
0
mirror of https://github.com/bitwarden/browser.git synced 2024-12-17 15:37:57 +01:00

use virtual scroll for favorite ciphers

This commit is contained in:
Thomas Rittson 2021-05-21 13:01:39 +10:00
parent 8151d5bcac
commit 081bda255c

View File

@ -23,14 +23,15 @@
</ng-container> </ng-container>
</div> </div>
<ng-container *ngIf="ciphers && ciphers.length && !showSearching()"> <ng-container *ngIf="ciphers && ciphers.length && !showSearching()">
<cdk-virtual-scroll-viewport itemSize="46">
<div class="box list" *ngIf="favoriteCiphers"> <div class="box list" *ngIf="favoriteCiphers">
<div class="box-header"> <div class="box-header">
{{'favorites' | i18n}} {{'favorites' | i18n}}
<span class="flex-right">{{favoriteCiphers.length}}</span> <span class="flex-right">{{favoriteCiphers.length}}</span>
</div> </div>
<div class="box-content"> <div class="box-content">
<app-ciphers-list [ciphers]="favoriteCiphers" title="{{'viewItem' | i18n}}" <app-cipher-row *cdkVirtualFor="let c of favoriteCiphers" [cipher]="c" title="{{'viewItem' | i18n}}"
(onSelected)="selectCipher($event)" (launchEvent)="launchCipher($event)"></app-ciphers-list> (onSelected)="selectCipher($event)" (launchEvent)="launchCipher($event)"></app-cipher-row>
</div> </div>
</div> </div>
<div class="box list"> <div class="box list">
@ -138,16 +139,19 @@
</a> </a>
</div> </div>
</div> </div>
</cdk-virtual-scroll-viewport>
</ng-container> </ng-container>
<ng-container *ngIf="showSearching()"> <ng-container *ngIf="showSearching()">
<div class="no-items" *ngIf="!ciphers || !ciphers.length"> <div class="no-items" *ngIf="!ciphers || !ciphers.length">
<p>{{'noItemsInList' | i18n}}</p> <p>{{'noItemsInList' | i18n}}</p>
</div> </div>
<div class="box list full-list" *ngIf="ciphers && ciphers.length > 0"> <cdk-virtual-scroll-viewport itemSize="46" *ngIf="ciphers && ciphers.length > 0">
<div class="box list full-list">
<div class="box-content"> <div class="box-content">
<app-ciphers-list [ciphers]="ciphers" title="{{'viewItem' | i18n}}" (onSelected)="selectCipher($event)" <app-cipher-row *cdkVirtualFor="let c of ciphers" [cipher]="c" title="{{'viewItem' | i18n}}"
(launchEvent)="launchCipher($event)"></app-ciphers-list> (onSelected)="selectCipher($event)" (launchEvent)="launchCipher($event)"></app-cipher-row>
</div> </div>
</div> </div>
</cdk-virtual-scroll-viewport>
</ng-container> </ng-container>
</content> </content>