From 816249a48a537258647486d90f097a08a551e5bc Mon Sep 17 00:00:00 2001 From: Thomas Rittson <31796059+eliykat@users.noreply.github.com> Date: Wed, 11 Aug 2021 13:00:04 +1000 Subject: [PATCH] Use cdk-virtual-scroll for long cipher lists (#1001) * Use cdk-virtual-scroll for cipher lists * add trackBy, reorder dom * Undo merge conflict error * Fix layout, increase scrolling buffer * fix linting * Remove unused infinite-scroll directives for Send * Add back refresh method * Update jslib * Fix itemSize and min/maxBufferPx directives * Move refresh() into base class * Use cipherListVirtualScroll strategy * fix linting * Update to use latest virtual-scroll strategy * Update jslib --- jslib | 2 +- src/app/app.module.ts | 6 ++++-- src/app/send/send.component.html | 3 +-- src/app/vault/ciphers.component.html | 28 +++++++++++++--------------- src/app/vault/ciphers.component.ts | 9 ++++----- src/scss/base.scss | 18 +++++++++++++++--- 6 files changed, 38 insertions(+), 28 deletions(-) diff --git a/jslib b/jslib index 23309d33e2..c70c8ecc24 160000 --- a/jslib +++ b/jslib @@ -1 +1 @@ -Subproject commit 23309d33e2a335574ed898d6543040372d41526a +Subproject commit c70c8ecc247cb92e1f867630031fd5cdf124bcd3 diff --git a/src/app/app.module.ts b/src/app/app.module.ts index 741f0564e7..4a0bd7f5ab 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -1,12 +1,12 @@ import 'zone.js/dist/zone'; import { ToasterModule } from 'angular2-toaster'; -import { InfiniteScrollModule } from 'ngx-infinite-scroll'; import { AppRoutingModule } from './app-routing.module'; import { ServicesModule } from './services.module'; import { DragDropModule } from '@angular/cdk/drag-drop'; +import { ScrollingModule } from '@angular/cdk/scrolling'; import { DatePipe } from '@angular/common'; import { NgModule } from '@angular/core'; import { FormsModule, ReactiveFormsModule } from '@angular/forms'; @@ -36,6 +36,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 { SelectCopyDirective } from 'jslib-angular/directives/select-copy.directive'; import { StopClickDirective } from 'jslib-angular/directives/stop-click.directive'; @@ -164,10 +165,10 @@ registerLocaleData(localeZhTw, 'zh-TW'); BrowserModule, DragDropModule, FormsModule, - InfiniteScrollModule, ReactiveFormsModule, ServicesModule, ToasterModule.forRoot(), + ScrollingModule, ], declarations: [ A11yTitleDirective, @@ -179,6 +180,7 @@ registerLocaleData(localeZhTw, 'zh-TW'); BlurClickDirective, BoxRowDirective, CalloutComponent, + CipherListVirtualScroll, CiphersComponent, CollectionsComponent, ColorPasswordPipe, diff --git a/src/app/send/send.component.html b/src/app/send/send.component.html index 8c14ea75d2..e4740c902d 100644 --- a/src/app/send/send.component.html +++ b/src/app/send/send.component.html @@ -39,8 +39,7 @@