aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/collections/CollectionSubView.tsx
diff options
context:
space:
mode:
authorNaafiyan Ahmed <naafiyan@gmail.com>2022-03-17 12:17:27 -0400
committerGitHub <noreply@github.com>2022-03-17 12:17:27 -0400
commit5c874c6829d9957696dfe61014173b6800c864df (patch)
tree23b7206679d500fc039a4302255cf3d6e17b47d3 /src/client/views/collections/CollectionSubView.tsx
parenta299d1766aa7f4bf3e6bbc3032a39b6b5ae28b4b (diff)
parent5a385e46937a2f79d557b4ee929e78ba78aca8bf (diff)
Merge pull request #55 from brown-dash/speedups2
Speedups2
Diffstat (limited to 'src/client/views/collections/CollectionSubView.tsx')
-rw-r--r--src/client/views/collections/CollectionSubView.tsx11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/client/views/collections/CollectionSubView.tsx b/src/client/views/collections/CollectionSubView.tsx
index fc1bcb8b9..42e157396 100644
--- a/src/client/views/collections/CollectionSubView.tsx
+++ b/src/client/views/collections/CollectionSubView.tsx
@@ -10,14 +10,14 @@ import { Cast, ScriptCast, NumCast, StrCast } from "../../../fields/Types";
import { GestureUtils } from "../../../pen-gestures/GestureUtils";
import { Utils, returnFalse, returnEmptyFilter } from "../../../Utils";
import { DocServer } from "../../DocServer";
-import { Networking } from "../../Network";
import { ImageUtils } from "../../util/Import & Export/ImageUtils";
import { InteractionUtils } from "../../util/InteractionUtils";
import { undoBatch, UndoManager } from "../../util/UndoManager";
import { DocComponent } from "../DocComponent";
import React = require("react");
-import * as rp from 'request-promise';
import ReactLoading from 'react-loading';
+import * as rp from 'request-promise';
+import { Networking } from "../../Network";
export interface SubCollectionViewProps extends CollectionViewProps {
@@ -25,15 +25,15 @@ export interface SubCollectionViewProps extends CollectionViewProps {
isAnyChildContentActive: () => boolean;
}
-export function CollectionSubView<T, X>(schemaCtor: (doc: Doc) => T, moreProps?: X) {
- class CollectionSubView extends DocComponent<X & SubCollectionViewProps, T>(schemaCtor) {
+export function CollectionSubView<X>(moreProps?: X) {
+ class CollectionSubView extends DocComponent<X & SubCollectionViewProps>() {
private dropDisposer?: DragManager.DragDropDisposer;
private gestureDisposer?: GestureUtils.GestureEventDisposer;
protected _multiTouchDisposer?: InteractionUtils.MultiTouchEventDisposer;
protected _mainCont?: HTMLDivElement;
@observable _focusFilters: Opt<string[]>; // docFilters that are overridden when previewing a link to an anchor which has docFilters set on it
@observable _focusRangeFilters: Opt<string[]>; // docRangeFilters that are overridden when previewing a link to an anchor which has docRangeFilters set on it
- protected createDashEventsTarget = (ele: HTMLDivElement) => { //used for stacking and masonry view
+ protected createDashEventsTarget = (ele: HTMLDivElement | null) => { //used for stacking and masonry view
this.dropDisposer?.();
this.gestureDisposer?.();
this._multiTouchDisposer?.();
@@ -446,6 +446,7 @@ export function CollectionSubView<T, X>(schemaCtor: (doc: Doc) => T, moreProps?:
generatedDocuments.push(...await DocUtils.uploadFilesToDocs(files, options));
}
if (generatedDocuments.length) {
+ // Creating a dash document
const isFreeformView = this.props.Document._viewType === CollectionViewType.Freeform;
const set = !isFreeformView ? generatedDocuments :
generatedDocuments.length > 1 ? generatedDocuments.map(d => { DocUtils.iconify(d); return d; }) : [];