Skip to content

Commit

Permalink
Use custom virtual scroll strategy (#2002)
Browse files Browse the repository at this point in the history
* update jslib

* Use custom virtual scroll strategy
  • Loading branch information
eliykat authored Aug 11, 2021
1 parent 090e9f3 commit 69c8928
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 4 deletions.
2 changes: 2 additions & 0 deletions src/popup/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ import { ApiActionDirective } from 'jslib-angular/directives/api-action.directiv
import { AutofocusDirective } from 'jslib-angular/directives/autofocus.directive';
import { BlurClickDirective } from 'jslib-angular/directives/blur-click.directive';
import { BoxRowDirective } from 'jslib-angular/directives/box-row.directive';
import { CipherListVirtualScroll } from 'jslib-angular/directives/cipherListVirtualScroll.directive';
import { FallbackSrcDirective } from 'jslib-angular/directives/fallback-src.directive';
import { InputVerbatimDirective } from 'jslib-angular/directives/input-verbatim.directive';
import { SelectCopyDirective } from 'jslib-angular/directives/select-copy.directive';
Expand Down Expand Up @@ -190,6 +191,7 @@ registerLocaleData(localeZhTw, 'zh-TW');
BlurClickDirective,
BoxRowDirective,
CalloutComponent,
CipherListVirtualScroll,
CipherRowComponent,
CiphersComponent,
CollectionsComponent,
Expand Down
2 changes: 1 addition & 1 deletion src/popup/components/cipher-row.component.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<a (click)="selectCipher(cipher)" (dblclick)="launchCipher(cipher)" href="#" appStopClick
title="{{title}} - {{cipher.name}}" class="box-content-row box-content-row-flex">
title="{{title}} - {{cipher.name}}" class="box-content-row box-content-row-flex virtual-scroll-item">
<div class="row-main">
<app-vault-icon [cipher]="cipher"></app-vault-icon>
<div class="row-main-content">
Expand Down
3 changes: 2 additions & 1 deletion src/popup/vault/ciphers.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,8 @@
</button>
</ng-container>
</div>
<cdk-virtual-scroll-viewport itemSize="46" *ngIf="ciphers.length" #virtualScrollViewport>
<cdk-virtual-scroll-viewport itemSize="46" minBufferPx="400" maxBufferPx="600" *ngIf="ciphers.length"
#virtualScrollViewport>
<div class="box list only-list">
<div class="box-header">
{{groupingTitle}}
Expand Down
3 changes: 2 additions & 1 deletion src/popup/vault/groupings.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,8 @@
<div class="no-items" *ngIf="!ciphers || !ciphers.length">
<p>{{'noItemsInList' | i18n}}</p>
</div>
<cdk-virtual-scroll-viewport itemSize="46" *ngIf="ciphers && ciphers.length > 0">
<cdk-virtual-scroll-viewport itemSize="46" minBufferPx="400" maxBufferPx="600"
*ngIf="ciphers && ciphers.length > 0">
<div class="box list full-list">
<div class="box-content">
<app-cipher-row *cdkVirtualFor="let searchedCipher of ciphers" [cipher]="searchedCipher"
Expand Down

0 comments on commit 69c8928

Please sign in to comment.