diff options
| author | laurawilsonri <laura_wilson@brown.edu> | 2019-02-25 19:44:58 -0500 |
|---|---|---|
| committer | laurawilsonri <laura_wilson@brown.edu> | 2019-02-25 19:44:58 -0500 |
| commit | 171852260c04ba7aafd789b231d98cdaa2a7dc8d (patch) | |
| tree | 53ca1cf310bc099e4cbad07adc2efaa9dc3d12c9 /src/client/views/collections/CollectionView.tsx | |
| parent | 03b35e3d6346800821bb830a7c102dede74647fe (diff) | |
all but removing preview cursor works
Diffstat (limited to 'src/client/views/collections/CollectionView.tsx')
| -rw-r--r-- | src/client/views/collections/CollectionView.tsx | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/src/client/views/collections/CollectionView.tsx b/src/client/views/collections/CollectionView.tsx index 90080ab43..57d876996 100644 --- a/src/client/views/collections/CollectionView.tsx +++ b/src/client/views/collections/CollectionView.tsx @@ -1,4 +1,4 @@ -import { action, computed } from "mobx"; +import { action, computed, observable } from "mobx"; import { observer } from "mobx-react"; import { Document } from "../../../fields/Document"; import { ListField } from "../../../fields/ListField"; @@ -11,6 +11,7 @@ import { CollectionFreeFormView } from "./CollectionFreeFormView"; import { CollectionDockingView } from "./CollectionDockingView"; import { CollectionSchemaView } from "./CollectionSchemaView"; import { CollectionViewProps } from "./CollectionViewBase"; +var ReactDOM = require('react-dom'); @@ -26,6 +27,8 @@ export const COLLECTION_BORDER_WIDTH = 2; @observer export class CollectionView extends React.Component<CollectionViewProps> { + private _focusOn: boolean = false; + public static LayoutString(fieldKey: string = "DataKey") { return `<CollectionView Document={Document} ScreenToLocalTransform={ScreenToLocalTransform} fieldKey={${fieldKey}} isSelected={isSelected} select={select} bindings={bindings} @@ -59,6 +62,21 @@ export class CollectionView extends React.Component<CollectionViewProps> { return false } + + + @computed + get isFocusOn() { return this._focusOn; } + + @action + showPreviewCursor() { + this._focusOn = true; + } + + @action + hidePreviewCursor() { + this._focusOn = false; + } + get collectionViewType(): CollectionViewType { let Document = this.props.Document; let viewField = Document.GetT(KeyStore.ViewType, NumberField); @@ -76,6 +94,7 @@ export class CollectionView extends React.Component<CollectionViewProps> { Document.SetData(KeyStore.ViewType, type, NumberField); } + render() { let viewType = this.collectionViewType; switch (viewType) { |
