diff options
author | bob <bcz@cs.brown.edu> | 2019-01-31 13:19:39 -0500 |
---|---|---|
committer | bob <bcz@cs.brown.edu> | 2019-01-31 13:19:39 -0500 |
commit | 73bff98b9476df0ecc91af548d80b30f56967a8d (patch) | |
tree | 9764fc4482522a09a61056608ee0c3bb8dfde1fd | |
parent | e882783aeb3e425c339a15d80e602674261d2823 (diff) |
working?
-rw-r--r-- | src/Main.tsx | 4 | ||||
-rw-r--r-- | src/views/collections/CollectionDockingView.tsx | 4 | ||||
-rw-r--r-- | src/views/nodes/DocumentView.tsx | 2 |
3 files changed, 7 insertions, 3 deletions
diff --git a/src/Main.tsx b/src/Main.tsx index 2770ccff2..56065b946 100644 --- a/src/Main.tsx +++ b/src/Main.tsx @@ -23,7 +23,7 @@ configure({ const mainNodeCollection = new Array<Document>(); let mainContainer = Documents.DockDocument(mainNodeCollection, { - x: 0, y: 0, width: window.screen.width, height: window.screen.height, title: "main container" + x: 0, y: 0, title: "main container" }) window.addEventListener("drop", function (e) { @@ -76,7 +76,7 @@ document.addEventListener("pointerdown", action(function (e: PointerEvent) { //); ReactDOM.render(( - <div style={{ display: "grid" }}> + <div style={{ position: "absolute", width: "100%", height: "100%" }}> <DocumentView Document={mainContainer} ContainingCollectionView={undefined} ContainingDocumentView={undefined} /> <DocumentDecorations /> <ContextMenu /> diff --git a/src/views/collections/CollectionDockingView.tsx b/src/views/collections/CollectionDockingView.tsx index b64e4179d..e1d36864f 100644 --- a/src/views/collections/CollectionDockingView.tsx +++ b/src/views/collections/CollectionDockingView.tsx @@ -16,6 +16,7 @@ import 'golden-layout/src/css/goldenlayout-dark-theme.css'; import * as GoldenLayout from "golden-layout"; import * as ReactDOM from 'react-dom'; import { DragManager } from "../../util/DragManager"; +import { CollectionFreeFormView } from "./CollectionFreeFormView"; @observer export class CollectionDockingView extends React.Component<CollectionViewProps> { @@ -68,6 +69,9 @@ export class CollectionDockingView extends React.Component<CollectionViewProps> componentDidMount: () => void = () => { if (this._containerRef.current && CollectionDockingView.UseGoldenLayout) { this.goldenLayoutFactory(); + window.addEventListener('resize', function (event) { + CollectionDockingView.myLayout.updateSize(window.innerWidth, window.innerHeight); + }); } } private nextId = (function () { var _next_id = 0; return function () { return _next_id++; } })(); diff --git a/src/views/nodes/DocumentView.tsx b/src/views/nodes/DocumentView.tsx index 7e2635438..5e72db492 100644 --- a/src/views/nodes/DocumentView.tsx +++ b/src/views/nodes/DocumentView.tsx @@ -312,7 +312,7 @@ export class DocumentView extends React.Component<DocumentViewProps> { render() { - var freestyling = this.props.ContainingCollectionView === undefined || this.props.ContainingCollectionView instanceof CollectionFreeFormView; + var freestyling = this.props.ContainingCollectionView instanceof CollectionFreeFormView; return ( <div className="node" ref={this._mainCont} style={{ transform: freestyling ? this.transform : "", |