From 11327191e249382cc5d2551f1fd262d3a4ff25b9 Mon Sep 17 00:00:00 2001 From: laurawilsonri Date: Mon, 25 Feb 2019 20:58:11 -0500 Subject: ALL SETgit add -A --- src/client/views/collections/CollectionFreeFormView.tsx | 10 +++++----- src/client/views/collections/CollectionView.tsx | 17 ----------------- 2 files changed, 5 insertions(+), 22 deletions(-) (limited to 'src/client/views/collections') diff --git a/src/client/views/collections/CollectionFreeFormView.tsx b/src/client/views/collections/CollectionFreeFormView.tsx index c2d2b0f7b..cd88c931b 100644 --- a/src/client/views/collections/CollectionFreeFormView.tsx +++ b/src/client/views/collections/CollectionFreeFormView.tsx @@ -90,7 +90,6 @@ export class CollectionFreeFormView extends CollectionViewBase { if (Math.abs(this._downX - e.clientX) < 3 && Math.abs(this._downY - e.clientY) < 3) { //show preview text cursor on tap this._previewCursorVisible = true; - this.props.CollectionView.showPreviewCursor(); //select is not already selected if (!this.props.isSelected()) { this.props.select(false); @@ -262,17 +261,17 @@ export class CollectionFreeFormView extends CollectionViewBase { getLocalTransform = (): Transform => Transform.Identity.translate(-this.panX, -this.panY).scale(1 / this.scale); noScaling = () => 1; - //hides the preview cursor for generating new text boxes - called when other docs are selected/dragged + //when focus is lost, this will remove the preview cursor @action - hidePreviewCursor() { + onBlur = (e: React.FocusEvent): void => { this._previewCursorVisible = false; } render() { + //determines whether preview text cursor should be visible (ie when user taps this collection it should) let cursor = null; - //toggle for preview cursor -> will be on when user taps freeform - if (this._previewCursorVisible && this.props.CollectionView.isFocusOn) { + if (this._previewCursorVisible) { //get local position and place cursor there! let [x, y] = this.getTransform().transformPoint(this._downX, this._downY); cursor =
I
@@ -289,6 +288,7 @@ export class CollectionFreeFormView extends CollectionViewBase { onContextMenu={(e) => e.preventDefault()} onDrop={this.onDrop.bind(this)} onDragOver={this.onDragOver} + onBlur={this.onBlur} style={{ borderWidth: `${COLLECTION_BORDER_WIDTH}px`, }} tabIndex={0} ref={this.createDropTarget}> diff --git a/src/client/views/collections/CollectionView.tsx b/src/client/views/collections/CollectionView.tsx index 6ab0f15c0..11cc6d28e 100644 --- a/src/client/views/collections/CollectionView.tsx +++ b/src/client/views/collections/CollectionView.tsx @@ -28,8 +28,6 @@ export const COLLECTION_BORDER_WIDTH = 2; @observer export class CollectionView extends React.Component { - private _focusOn: boolean = false; - public static LayoutString(fieldKey: string = "DataKey") { return ` { 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); -- cgit v1.2.3-70-g09d2