From 99ce76f0f21b48d8186e6aba1a0e64c87b2c0649 Mon Sep 17 00:00:00 2001 From: bobzel Date: Mon, 14 Feb 2022 13:44:47 -0500 Subject: added an incremental load for freeform collections. fixed updating of web page thumbs on deselection after the first thumb is generated. --- .../collectionFreeForm/CollectionFreeFormView.tsx | 8 +++++++- src/client/views/nodes/DocumentView.tsx | 4 ++-- src/client/views/nodes/WebBox.tsx | 18 +++++++++++------- src/fields/util.ts | 2 +- src/server/ApiManagers/UploadManager.ts | 2 +- 5 files changed, 22 insertions(+), 12 deletions(-) (limited to 'src') diff --git a/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx b/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx index aeda71d01..2df053c50 100644 --- a/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx +++ b/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx @@ -1300,6 +1300,7 @@ export class CollectionFreeFormView extends CollectionSubView { + this.numLoaded < this.views.length && setTimeout(action(() => this.numLoaded += 10), 500); const children = typeof this.props.children === "function" ? (this.props.children as any)() as JSX.Element[] : []; - return [...children, ...this.views, ]; + return [ + ...children, + ...this.views.slice(0, Math.min(this.views.length, this.numLoaded + 10)), + + ]; } chooseGridSpace = (gridSpace: number): number => { diff --git a/src/client/views/nodes/DocumentView.tsx b/src/client/views/nodes/DocumentView.tsx index 19b16f071..b537cd370 100644 --- a/src/client/views/nodes/DocumentView.tsx +++ b/src/client/views/nodes/DocumentView.tsx @@ -840,7 +840,7 @@ export class DocumentViewInternal extends DocComponent {(this.isContentActive() && !SnappingManager.GetIsDragging()) || !thumb ? (null) : - this._iframe = r)} src={"https://crossorigin.me/https://cs.brown.edu"} />; } + setTimeout(action(() => this._webPageHasBeenRendered = true)); return view; } @@ -703,9 +708,8 @@ export class WebBox extends ViewBoxAnnotatableComponent; return (
-