From adecb4a47cac3c2f92d11d8f500d4decf70a06d1 Mon Sep 17 00:00:00 2001
From: Tyler Schicke <tyler_schicke@brown.edu>
Date: Tue, 2 Apr 2019 13:00:00 -0400
Subject: More work on collection refactor

---
 src/client/views/collections/CollectionViewBase.tsx | 15 ++-------------
 1 file changed, 2 insertions(+), 13 deletions(-)

(limited to 'src/client/views/collections/CollectionViewBase.tsx')

diff --git a/src/client/views/collections/CollectionViewBase.tsx b/src/client/views/collections/CollectionViewBase.tsx
index c5a6c53b3..ca4f3b12f 100644
--- a/src/client/views/collections/CollectionViewBase.tsx
+++ b/src/client/views/collections/CollectionViewBase.tsx
@@ -20,17 +20,9 @@ import { Server } from "../../Server";
 import { FieldViewProps } from "../nodes/FieldView";
 
 export interface CollectionViewProps extends FieldViewProps {
-    ScreenToLocalTransform: () => Transform;
-    panelWidth: () => number;
-    panelHeight: () => number;
-    focus: (doc: Document) => void;
 }
 
 export interface SubCollectionViewProps extends CollectionViewProps {
-    active: () => boolean;
-    addDocument: (doc: Document, allowDuplicates: boolean) => boolean;
-    removeDocument: (doc: Document) => boolean;
-    CollectionView: CollectionView;
 }
 
 export type CursorEntry = TupleField<[string, string], [number, number]>;
@@ -127,8 +119,6 @@ export class CollectionViewBase extends React.Component<SubCollectionViewProps>
 
     @action
     protected onDrop(e: React.DragEvent, options: DocumentOptions): void {
-        let that = this;
-
         let html = e.dataTransfer.getData("text/html");
         let text = e.dataTransfer.getData("text/plain");
 
@@ -151,7 +141,6 @@ export class CollectionViewBase extends React.Component<SubCollectionViewProps>
             let item = e.dataTransfer.items[i];
             if (item.kind === "string" && item.type.indexOf("uri") != -1) {
                 e.dataTransfer.items[i].getAsString(action((s: string) => {
-                    let document: Document;
                     request.head(ServerUtils.prepend(RouteStore.corsProxy + "/" + s), (err, res, body) => {
                         let type = res.headers["content-type"];
                         if (type) {
@@ -184,11 +173,11 @@ export class CollectionViewBase extends React.Component<SubCollectionViewProps>
                         runInAction(() => {
                             let doc = this.getDocumentFromType(type, path, { ...options, nativeWidth: 300, width: 300 })
 
-                            let docs = that.props.Document.GetT(KeyStore.Data, ListField);
+                            let docs = this.props.Document.GetT(KeyStore.Data, ListField);
                             if (docs != FieldWaiting) {
                                 if (!docs) {
                                     docs = new ListField<Document>();
-                                    that.props.Document.Set(KeyStore.Data, docs)
+                                    this.props.Document.Set(KeyStore.Data, docs)
                                 }
                                 if (doc) {
                                     docs.Data.push(doc);
-- 
cgit v1.2.3-70-g09d2

