aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/collections/CollectionDockingView.tsx
diff options
context:
space:
mode:
authorbob <bcz@cs.brown.edu>2019-02-19 17:15:59 -0500
committerbob <bcz@cs.brown.edu>2019-02-19 17:15:59 -0500
commitaf42b410a1575527094e2ec96e7df72f224ef45d (patch)
tree8179ce6f0def5a56805b12685127c9639af5b73e /src/client/views/collections/CollectionDockingView.tsx
parent735a70382c6f17060aa06fe08640924cba7f52a9 (diff)
clean up and aspect resizing w/ doc dec.
Diffstat (limited to 'src/client/views/collections/CollectionDockingView.tsx')
-rw-r--r--src/client/views/collections/CollectionDockingView.tsx12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/client/views/collections/CollectionDockingView.tsx b/src/client/views/collections/CollectionDockingView.tsx
index 9c396e412..842312faa 100644
--- a/src/client/views/collections/CollectionDockingView.tsx
+++ b/src/client/views/collections/CollectionDockingView.tsx
@@ -98,7 +98,6 @@ export class CollectionDockingView extends CollectionViewBase {
if (this._goldenLayout.root.contentItems[0].isRow) {
this._goldenLayout.root.contentItems[0].addChild(newContentItem);
- collayout.callDownwards('setSize');
}
else {
var collayout = this._goldenLayout.root.contentItems[0];
@@ -110,7 +109,6 @@ export class CollectionDockingView extends CollectionViewBase {
collayout.config["width"] = 50;
newContentItem.config["width"] = 50;
- collayout.parent.callDownwards('setSize');
}
this._forceRecreate = true;
}
@@ -227,12 +225,16 @@ interface DockedFrameProps {
@observer
export class DockedFrameRenderer extends React.Component<DockedFrameProps> {
- private _mainCont = React.createRef<HTMLDivElement>();
+ _mainCont: any = null;
constructor(props: any) {
super(props);
Server.GetField(this.props.documentId, (f) => { this.Document = f as Document; })
}
+ setMainCont: any = (element: any) => {
+ this._mainCont = element;
+ }
+
@observable
private _parentScaling = 1; // used to transfer the dimensions of the content pane in the DOM to the ParentScaling prop of the DocumentView
@@ -245,13 +247,13 @@ export class DockedFrameRenderer extends React.Component<DockedFrameProps> {
let nativeWidth = this.Document.GetNumber(KeyStore.NativeWidth, 0);
var layout = this.Document.GetText(KeyStore.Layout, "");
var content =
- <div ref={this._mainCont}>
+ <div ref={this.setMainCont}>
<DocumentView key={this.Document.Id} Document={this.Document}
AddDocument={undefined}
RemoveDocument={undefined}
Scaling={this._parentScaling}
ScreenToLocalTransform={() => {
- let { scale, translateX, translateY } = Utils.GetScreenTransform(this._mainCont.current!);
+ let { scale, translateX, translateY } = Utils.GetScreenTransform(this._mainCont);
var props = CollectionDockingView.Instance.props;
return props.ScreenToLocalTransform().translate(-translateX, -translateY).scale(scale / this._parentScaling)
}}