From bdeeb202d264b2710f21b816f4e05a29793aa78e Mon Sep 17 00:00:00 2001 From: bobzel Date: Thu, 23 Mar 2023 21:17:43 -0400 Subject: fixed dragging schema rows. fixed not being able to click row buttons unless schema view is active. --- .../collections/collectionSchema/CollectionSchemaView.tsx | 12 +++++------- .../views/collections/collectionSchema/SchemaRowBox.tsx | 3 ++- 2 files changed, 7 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/client/views/collections/collectionSchema/CollectionSchemaView.tsx b/src/client/views/collections/collectionSchema/CollectionSchemaView.tsx index 5f795c5ac..151e6cbef 100644 --- a/src/client/views/collections/collectionSchema/CollectionSchemaView.tsx +++ b/src/client/views/collections/collectionSchema/CollectionSchemaView.tsx @@ -884,6 +884,8 @@ export class CollectionSchemaView extends CollectionSubView() { rowHeightFunc = () => CollectionSchemaView._rowHeight; rowClickScriptFunc = () => this.rowOnClickScript; isContentActive = () => this.props.isSelected() || this.props.isContentActive(); + screenToLocal = () => this.props.ScreenToLocalTransform().translate(-this.tableWidth, 0); + previewWidthFunc = () => this.previewWidth; render() { return (
-
+
this.previewWidth} + PanelWidth={this.previewWidthFunc} PanelHeight={this.props.PanelHeight} isContentActive={returnTrue} isDocumentActive={returnFalse} - ScreenToLocalTransform={() => this.props.ScreenToLocalTransform().translate(-this.tableWidth, 0)} + ScreenToLocalTransform={this.screenToLocal} docFilters={this.childDocFilters} docRangeFilters={this.childDocRangeFilters} searchFilterDocs={this.searchFilterDocs} diff --git a/src/client/views/collections/collectionSchema/SchemaRowBox.tsx b/src/client/views/collections/collectionSchema/SchemaRowBox.tsx index aa69e2b9c..87284be70 100644 --- a/src/client/views/collections/collectionSchema/SchemaRowBox.tsx +++ b/src/client/views/collections/collectionSchema/SchemaRowBox.tsx @@ -39,7 +39,7 @@ export class SchemaRowBox extends ViewBoxBaseComponent() { @action onRowPointerDown = (e: React.PointerEvent) => { if (!this.isContentActive()) return; - setupMoveUpEvents(this, e, e => this.schemaView?.startDrag(e, this.rootDoc, this.rowIndex) ?? true, emptyFunction, emptyFunction, false); + setupMoveUpEvents(this, e, e => this.schemaView?.startDrag(e, this.rootDoc, this.rowIndex) ?? true, emptyFunction, emptyFunction); }; onPointerEnter = (e: any) => { @@ -99,6 +99,7 @@ export class SchemaRowBox extends ViewBoxBaseComponent() { className="row-menu" style={{ width: CollectionSchemaView._rowMenuWidth, + pointerEvents: !this.isContentActive() ? 'none' : undefined, }}>