From ec2b0b56058fce137ff28ae3ec125f9e695f315c Mon Sep 17 00:00:00 2001 From: Tyler Schicke Date: Tue, 19 Feb 2019 05:19:50 -0500 Subject: Changed some names, added some comments, and got rid of some unused stuff --- src/client/views/nodes/DocumentView.tsx | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/client/views/nodes') diff --git a/src/client/views/nodes/DocumentView.tsx b/src/client/views/nodes/DocumentView.tsx index f368fdeaf..14268c644 100644 --- a/src/client/views/nodes/DocumentView.tsx +++ b/src/client/views/nodes/DocumentView.tsx @@ -21,7 +21,6 @@ import { TextField } from "../../../fields/TextField"; const JsxParser = require('react-jsx-parser').default;//TODO Why does this need to be imported like this? export interface DocumentViewProps { - DocumentView: Opt // needed only to set ContainingDocumentView on CollectionViewProps when invoked from JsxParser -- is there a better way? ContainingCollectionView: Opt; Document: Document; @@ -29,6 +28,7 @@ export interface DocumentViewProps { RemoveDocument?: (doc: Document) => boolean; ScreenToLocalTransform: () => Transform; isTopMost: boolean; + //tfs: This shouldn't be necessary I don't think Scaling: number; } @@ -198,12 +198,13 @@ export class DocumentView extends React.Component { // // returns the cumulative scaling between the document and the screen + // tfs: I don't think this should be necessary // @computed public get ScalingToScreenSpace(): number { if (this.props.ContainingCollectionView != undefined && this.props.ContainingCollectionView.props.ContainingDocumentView != undefined) { - let ss = this.props.ContainingCollectionView.props.DocumentForCollection.GetNumber(KeyStore.Scale, 1); + let ss = this.props.ContainingCollectionView.props.Document.GetNumber(KeyStore.Scale, 1); return this.props.ContainingCollectionView.props.ContainingDocumentView.ScalingToScreenSpace * ss; } return 1; @@ -229,6 +230,7 @@ export class DocumentView extends React.Component { bindings[key.Name] = field && field != FieldWaiting ? field.GetValue() : field; } /* + tfs: Should this be moved to CollectionFreeformView or another component that renders Document backgrounds (or contents based on a layout key, which could be used here as well) that CollectionFreeformView uses? It seems like a lot for it to be here considering only one view currently uses it... @@ -245,6 +247,8 @@ export class DocumentView extends React.Component { bindings.BackgroundView = backgroundView; } + bindings.DocumentView = this; + var width = this.props.Document.GetNumber(KeyStore.NativeWidth, 0); var strwidth = width > 0 ? width.toString() + "px" : "100%"; var height = this.props.Document.GetNumber(KeyStore.NativeHeight, 0); -- cgit v1.2.3-70-g09d2