aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/collections/CollectionStackingView.tsx
diff options
context:
space:
mode:
authorBob Zeleznik <zzzman@gmail.com>2019-06-06 22:49:25 -0400
committerBob Zeleznik <zzzman@gmail.com>2019-06-06 22:49:25 -0400
commit852bd5c7b7e8d6c01ff0e6dbb5cef35f4bfd9617 (patch)
treed82cc5d2f3807f9c845e544fa4ff35cceedb9f2d /src/client/views/collections/CollectionStackingView.tsx
parentcdc7c701cb27e94b7fd5edf2cb088f5357199900 (diff)
added unfreeze for images, pdfs, etc. allows margins. improved rotate for images. added ctrl-drag to resize text. fixed minimizing to work with scaled views
Diffstat (limited to 'src/client/views/collections/CollectionStackingView.tsx')
-rw-r--r--src/client/views/collections/CollectionStackingView.tsx13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/client/views/collections/CollectionStackingView.tsx b/src/client/views/collections/CollectionStackingView.tsx
index af7e02e06..eeae498a6 100644
--- a/src/client/views/collections/CollectionStackingView.tsx
+++ b/src/client/views/collections/CollectionStackingView.tsx
@@ -11,6 +11,7 @@ import { DocumentView } from "../nodes/DocumentView";
import { CollectionSchemaPreview } from "./CollectionSchemaView";
import "./CollectionStackingView.scss";
import { CollectionSubView } from "./CollectionSubView";
+import { ContextMenu } from "../ContextMenu";
@observer
export class CollectionStackingView extends CollectionSubView(doc => doc) {
@@ -147,12 +148,22 @@ export class CollectionStackingView extends CollectionSubView(doc => doc) {
</div>);
})
}
+ onContextMenu = (e: React.MouseEvent): void => {
+ if (!e.isPropagationStopped() && this.props.Document[Id] !== "mainDoc") { // need to test this because GoldenLayout causes a parallel hierarchy in the React DOM for its children and the main document view7
+ ContextMenu.Instance.addItem({
+ description: "Toggle multi-column",
+ event: () => this.props.Document.singleColumn = !BoolCast(this.props.Document.singleColumn, false), icon: "file-pdf"
+ });
+ }
+ }
render() {
- let cols = this.singleColumn ? 1 : Math.floor((this.props.PanelWidth() - 2 * this.xMargin) / (this.columnWidth + 2 * this.gridGap));
+ let cols = this.singleColumn ? 1 : Math.min(this.childDocs.filter(d => !d.isMinimized).length,
+ Math.floor((this.props.PanelWidth() - 2 * this.xMargin) / (this.columnWidth + 2 * this.gridGap)));
let templatecols = "";
for (let i = 0; i < cols; i++) templatecols += `${this.columnWidth}px `;
return (
<div className="collectionStackingView" style={{ height: "100%" }}
+ onContextMenu={this.onContextMenu}
ref={this.createRef} onWheel={(e: React.WheelEvent) => e.stopPropagation()}>
<div className={`collectionStackingView-masonry${this.singleColumn ? "Single" : "Grid"}`}
style={{