From d5e6a9c5d57b7c3315fb71f25eff8f883cc687ef Mon Sep 17 00:00:00 2001
From: Lionel Han <47760119+IGoByJoe@users.noreply.github.com>
Date: Sat, 12 Sep 2020 13:29:48 -0700
Subject: cleaning up code

---
 src/client/views/collections/CollectionPileView.tsx | 21 ++++++++++-----------
 1 file changed, 10 insertions(+), 11 deletions(-)

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

diff --git a/src/client/views/collections/CollectionPileView.tsx b/src/client/views/collections/CollectionPileView.tsx
index e85aac2e3..8714751a6 100644
--- a/src/client/views/collections/CollectionPileView.tsx
+++ b/src/client/views/collections/CollectionPileView.tsx
@@ -1,27 +1,22 @@
-import { action, computed, observable, runInAction } from "mobx";
+import { action, computed, observable } from "mobx";
 import { observer } from "mobx-react";
 import { HeightSym, Opt, WidthSym, Doc } from "../../../fields/Doc";
 import { ScriptField } from "../../../fields/ScriptField";
-import { BoolCast, NumCast, StrCast } from "../../../fields/Types";
+import { NumCast, StrCast } from "../../../fields/Types";
 import { CollectionFreeFormView } from "./collectionFreeForm/CollectionFreeFormView";
 import { CollectionSubView } from "./CollectionSubView";
 import "./CollectionPileView.scss";
 import React = require("react");
-import { setupMoveUpEvents, emptyFunction, returnFalse } from "../../../Utils";
+import { setupMoveUpEvents, emptyFunction } from "../../../Utils";
 import { SelectionManager } from "../../util/SelectionManager";
 import { UndoManager, undoBatch } from "../../util/UndoManager";
 import { SnappingManager } from "../../util/SnappingManager";
-import { DragManager } from "../../util/DragManager";
 import { DocUtils } from "../../documents/Documents";
 
 @observer
 export class CollectionPileView extends CollectionSubView(doc => doc) {
-    _lastTap = 0;
-    _doubleTap: boolean | undefined = false;
     _originalChrome: string = "";
-    @observable _contentsActive = true;
-    @observable _collapsed: boolean = false;
-    @observable _childClickedScript: Opt<ScriptField>;
+
     componentDidMount() {
         if (this.layoutEngine() !== "pass" && this.layoutEngine() !== "starburst") {
             this.Document._pileLayoutEngine = "pass";
@@ -35,6 +30,7 @@ export class CollectionPileView extends CollectionSubView(doc => doc) {
 
     layoutEngine = () => StrCast(this.Document._pileLayoutEngine);
 
+    // returns the contents of the pileup in a CollectionFreeFormView
     @computed get contents() {
         const draggingSelf = this.props.isSelected();
         return <div className="collectionPileView-innards" style={{ pointerEvents: this.layoutEngine() === "starburst" || (SnappingManager.GetIsDragging() && !draggingSelf) ? undefined : "none", zIndex: this.layoutEngine() === "starburst" && !SnappingManager.GetIsDragging() ? -10 : "auto" }} >
@@ -49,6 +45,8 @@ export class CollectionPileView extends CollectionSubView(doc => doc) {
                 }} />
         </div>;
     }
+
+    // toggles the pileup between starburst to compact
     toggleStarburst = action(() => {
         if (this.layoutEngine() === 'starburst') {
             const defaultSize = 110;
@@ -79,11 +77,11 @@ export class CollectionPileView extends CollectionSubView(doc => doc) {
         }
     });
 
+    // for dragging documents out of the pileup view
     _undoBatch: UndoManager.Batch | undefined;
     pointerDown = (e: React.PointerEvent) => {
         let dist = 0;
         SnappingManager.SetIsDragging(true);
-        // this._lastTap should be set to 0, and this._doubleTap should be set to false in the class header
         setupMoveUpEvents(this, e, (e: PointerEvent, down: number[], delta: number[]) => {
             if (this.layoutEngine() === "pass" && this.childDocs.length && e.shiftKey) {
                 dist += Math.sqrt(delta[0] * delta[0] + delta[1] * delta[1]);
@@ -109,8 +107,9 @@ export class CollectionPileView extends CollectionSubView(doc => doc) {
         }, emptyFunction, e.shiftKey && this.layoutEngine() === "pass", this.layoutEngine() === "pass" && e.shiftKey); // this sets _doubleTap
     }
 
+    // onClick for toggling the pileup view
     onClick = (e: React.MouseEvent) => {
-        if (e.button === 0) {//} && this._doubleTap) {
+        if (e.button === 0) {
             SelectionManager.DeselectAll();
             this.toggleStarburst();
             e.stopPropagation();
-- 
cgit v1.2.3-70-g09d2

