From 064708ec835e873c016af78ccf44578a6cfc9cba Mon Sep 17 00:00:00 2001
From: bobzel <zzzman@gmail.com>
Date: Tue, 12 Apr 2022 00:09:46 -0400
Subject: cleaned up pileView to feel somewhat usable by tweaking icon sizes,
 and making icon<->doc toggleable by just clicking.

---
 src/client/views/collections/CollectionPileView.tsx | 6 ++++++
 1 file changed, 6 insertions(+)

(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 0ca0a463e..3d5552f81 100644
--- a/src/client/views/collections/CollectionPileView.tsx
+++ b/src/client/views/collections/CollectionPileView.tsx
@@ -11,6 +11,7 @@ import { CollectionFreeFormView } from "./collectionFreeForm/CollectionFreeFormV
 import "./CollectionPileView.scss";
 import { CollectionSubView } from "./CollectionSubView";
 import React = require("react");
+import { ScriptField } from "../../../fields/ScriptField";
 
 @observer
 export class CollectionPileView extends CollectionSubView() {
@@ -47,6 +48,10 @@ export class CollectionPileView extends CollectionSubView() {
         return this.props.moveDocument?.(doc, targetCollection, addDoc) || false;
     }
 
+    toggleIcon = () => {
+        return ScriptField.MakeScript("documentView.iconify()", { documentView: "any" });
+    }
+
     // returns the contents of the pileup in a CollectionFreeFormView
     @computed get contents() {
         const isStarburst = this.layoutEngine() === "starburst";
@@ -60,6 +65,7 @@ export class CollectionPileView extends CollectionSubView() {
                 layoutEngine={this.layoutEngine}
                 childDocumentsActive={isStarburst ? returnTrue : undefined}
                 addDocument={this.addPileDoc}
+                childClickScript={this.toggleIcon()}
                 moveDocument={this.removePileDoc} />
         </div>;
     }
-- 
cgit v1.2.3-70-g09d2

