aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/collections
diff options
context:
space:
mode:
authorbobzel <zzzman@gmail.com>2022-02-14 13:44:47 -0500
committerbobzel <zzzman@gmail.com>2022-02-14 13:44:47 -0500
commit99ce76f0f21b48d8186e6aba1a0e64c87b2c0649 (patch)
treee2b6c2abe0895fa316571ec017ad0d022a80ca82 /src/client/views/collections
parent956628a22c2d8ae21eb76c70f8f0a5a4edc9ae75 (diff)
added an incremental load for freeform collections. fixed updating of web page thumbs on deselection after the first thumb is generated.
Diffstat (limited to 'src/client/views/collections')
-rw-r--r--src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx8
1 files changed, 7 insertions, 1 deletions
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<PanZoomDocument, P
return { newPool, computedElementData: this.doFreeformLayout(newPool) };
}
+ @observable numLoaded = 0;
get doLayoutComputation() {
const { newPool, computedElementData } = this.doInternalLayoutComputation;
const array = Array.from(newPool.entries());
@@ -1558,8 +1559,13 @@ export class CollectionFreeFormView extends CollectionSubView<PanZoomDocument, P
}
children = () => {
+ 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, <CollectionFreeFormRemoteCursors {...this.props} key="remoteCursors" />];
+ return [
+ ...children,
+ ...this.views.slice(0, Math.min(this.views.length, this.numLoaded + 10)),
+ <CollectionFreeFormRemoteCursors {...this.props} key="remoteCursors" />
+ ];
}
chooseGridSpace = (gridSpace: number): number => {