diff options
| author | Bob Zeleznik <zzzman@gmail.com> | 2019-06-21 01:00:32 -0400 |
|---|---|---|
| committer | Bob Zeleznik <zzzman@gmail.com> | 2019-06-21 01:00:32 -0400 |
| commit | ce54e04c09ee0f7549d436f6ffe1f9f9b9efd7b5 (patch) | |
| tree | 1a6ce2135c9a02731d5681d797c0784cd499e2d0 /src/client/views/collections | |
| parent | 22e0ae1c7677a1fa3411e5ba05922b1d3b914b17 (diff) | |
user assignable templates
Diffstat (limited to 'src/client/views/collections')
| -rw-r--r-- | src/client/views/collections/CollectionView.tsx | 5 | ||||
| -rw-r--r-- | src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx | 12 |
2 files changed, 9 insertions, 8 deletions
diff --git a/src/client/views/collections/CollectionView.tsx b/src/client/views/collections/CollectionView.tsx index 6d3301ce4..e24466d57 100644 --- a/src/client/views/collections/CollectionView.tsx +++ b/src/client/views/collections/CollectionView.tsx @@ -60,8 +60,9 @@ export class CollectionView extends React.Component<FieldViewProps> { ContextMenu.Instance.addItem({ description: "View Modes...", subitems: subItems }); ContextMenu.Instance.addItem({ description: "Add Description Template", event: undoBatch(() => { - Doc.GetProto(this.props.Document).description = "my first templated box"; - let template = Doc.MakeAlias(this.props.Document); + let collection = this.props.Document; + Doc.GetProto(collection).description = "my first templated box"; + let template = Doc.MakeAlias(collection); template.layout = FormattedTextBox.LayoutString("description"); template.x = 0; template.y = 0; diff --git a/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx b/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx index bf47195d9..5c2ea3ef0 100644 --- a/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx +++ b/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx @@ -294,18 +294,18 @@ export class CollectionFreeFormView extends CollectionSubView(PanZoomDocument) { } - getDocumentViewProps(document: Doc): DocumentViewProps { + getDocumentViewProps(layoutDoc: Doc): DocumentViewProps { return { - Document: document, - DataDoc: this.props.DataDoc, + DataDoc: this.props.DataDoc !== this.props.Document ? this.props.DataDoc : layoutDoc, + Document: layoutDoc, addDocument: this.props.addDocument, removeDocument: this.props.removeDocument, moveDocument: this.props.moveDocument, ScreenToLocalTransform: this.getTransform, isTopMost: false, - selectOnLoad: document[Id] === this._selectOnLoaded, - PanelWidth: document[WidthSym], - PanelHeight: document[HeightSym], + selectOnLoad: layoutDoc[Id] === this._selectOnLoaded, + PanelWidth: layoutDoc[WidthSym], + PanelHeight: layoutDoc[HeightSym], ContentScaling: returnOne, ContainingCollectionView: this.props.CollectionView, focus: this.focusDocument, |
