1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-21 18:53:29 +00:00

infinite scrolling on cipher listing

This commit is contained in:
Kyle Spearrin
2018-04-11 10:23:12 -04:00
parent 3487fdb6e4
commit 744559516d
7 changed files with 252 additions and 42 deletions

View File

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