From 6d456bbe4a2de50abe1a4b338d1f446d3123b321 Mon Sep 17 00:00:00 2001 From: Eleanor Eng Date: Sat, 2 Mar 2019 19:07:00 -0500 Subject: with collection view --- .../views/collections/CollectionSchemaView.tsx | 9 +------- src/client/views/collections/CollectionView.tsx | 26 +++++++++++++++++----- 2 files changed, 22 insertions(+), 13 deletions(-) (limited to 'src/client/views/collections') diff --git a/src/client/views/collections/CollectionSchemaView.tsx b/src/client/views/collections/CollectionSchemaView.tsx index 22b5989a0..4beb0aea1 100644 --- a/src/client/views/collections/CollectionSchemaView.tsx +++ b/src/client/views/collections/CollectionSchemaView.tsx @@ -181,13 +181,6 @@ export class CollectionSchemaView extends CollectionViewBase { } } - //REPLACE THIS WITH CAPABILITIES SPECIFIC TO THIS TYPE OF NODE - collectionCapability = (e: React.MouseEvent): void => { - } - - specificContextMenu = (e: React.MouseEvent): void => { - ContextMenu.Instance.addItem({ description: "Collection Capability", event: this.collectionCapability }); - } @action setScaling = (r: any) => { const children = this.props.Document.GetList(this.props.fieldKey, []); @@ -227,7 +220,7 @@ export class CollectionSchemaView extends CollectionViewBase { let handle = !this.props.active() ? (null) : (
); return ( -
+
{ this._dividerX = r.entry.width; this._panelHeight = r.entry.height; diff --git a/src/client/views/collections/CollectionView.tsx b/src/client/views/collections/CollectionView.tsx index 03e1f1fa4..a7db07a42 100644 --- a/src/client/views/collections/CollectionView.tsx +++ b/src/client/views/collections/CollectionView.tsx @@ -87,27 +87,43 @@ export class CollectionView extends React.Component { Document.SetData(KeyStore.ViewType, type, NumberField); } + specificContextMenu = (e: React.MouseEvent): void => { + ContextMenu.Instance.addItem({ description: "Freeform", event: () => this.props.Document.SetNumber(KeyStore.ViewType, CollectionViewType.Freeform) }) + ContextMenu.Instance.addItem({ description: "Schema", event: () => this.props.Document.SetNumber(KeyStore.ViewType, CollectionViewType.Schema) }) + ContextMenu.Instance.addItem({ description: "Treeview", event: () => this.props.Document.SetNumber(KeyStore.ViewType, CollectionViewType.Tree) }) + ContextMenu.Instance.addItem({ description: "Docking", event: () => this.props.Document.SetNumber(KeyStore.ViewType, CollectionViewType.Docking) }) + } + render() { let viewType = this.collectionViewType; + let subView: JSX.Element; switch (viewType) { case CollectionViewType.Freeform: - return () + break; case CollectionViewType.Schema: - return () + break; case CollectionViewType.Docking: - return () + break; case CollectionViewType.Tree: - return () + break; default: - return
+ subView =
+ break; } + return (
+ {subView} +
) } } \ No newline at end of file -- cgit v1.2.3-70-g09d2