aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/nodes/DocumentView.tsx
diff options
context:
space:
mode:
authorMonika Hedman <monika_hedman@brown.edu>2019-04-01 23:07:04 -0400
committerMonika Hedman <monika_hedman@brown.edu>2019-04-01 23:07:04 -0400
commit7fdf7396a8bdb2e4f8c3b27ca99a36727d85adae (patch)
treede27432772d8951561b670bab74a23e06faaa9c1 /src/client/views/nodes/DocumentView.tsx
parent945fb1c28fa94ee1d2448381d7dd55b99214aad4 (diff)
minimize sorta works???
Diffstat (limited to 'src/client/views/nodes/DocumentView.tsx')
-rw-r--r--src/client/views/nodes/DocumentView.tsx32
1 files changed, 21 insertions, 11 deletions
diff --git a/src/client/views/nodes/DocumentView.tsx b/src/client/views/nodes/DocumentView.tsx
index 085307461..713c12975 100644
--- a/src/client/views/nodes/DocumentView.tsx
+++ b/src/client/views/nodes/DocumentView.tsx
@@ -7,7 +7,6 @@ import {
observable
} from "mobx";
import { library } from "@fortawesome/fontawesome-svg-core";
-import { faSquare } from "@fortawesome/free-solid-svg-icons";
import { observer } from "mobx-react";
import { Document } from "../../../fields/Document";
import { Field, Opt, FieldWaiting } from "../../../fields/Field";
@@ -33,8 +32,6 @@ import React = require("react");
import { ServerUtils } from "../../../server/ServerUtil";
import { DocumentDecorations } from "../DocumentDecorations";
-library.add(faSquare);
-
export interface DocumentViewProps {
ContainingCollectionView: Opt<CollectionView>;
Document: Document;
@@ -438,6 +435,11 @@ export class DocumentView extends React.Component<DocumentViewProps> {
return this.minimized;
};
+ @action
+ expand = () => {
+ this.minimized = false;
+ };
+
isSelected = () => {
return SelectionManager.IsSelected(this);
};
@@ -450,18 +452,26 @@ export class DocumentView extends React.Component<DocumentViewProps> {
if (!this.props.Document) {
return null;
}
+
+ var scaling = this.props.ContentScaling();
+ var nativeWidth = this.props.Document.GetNumber(KeyStore.NativeWidth, 0);
+ var nativeHeight = this.props.Document.GetNumber(KeyStore.NativeHeight, 0);
+
if (this.minimized) {
return (
- //<i class="fas fa-square" />
- <div className="minimized-box" />
+ <div
+ className="minimized-box"
+ ref={this._mainCont}
+ style={{
+ transformOrigin: "left top",
+ transform: `scale(${scaling} , ${scaling})`
+ }}
+ onClick={this.expand}
+ onDrop={this.onDrop}
+ onPointerDown={this.onPointerDown}
+ />
);
} else {
- var scaling = this.props.ContentScaling();
- var nativeWidth = this.props.Document.GetNumber(KeyStore.NativeWidth, 0);
- var nativeHeight = this.props.Document.GetNumber(
- KeyStore.NativeHeight,
- 0
- );
var backgroundcolor = this.props.Document.GetText(
KeyStore.BackgroundColor,
""