aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBob Zeleznik <zzzman@gmail.com>2020-06-21 22:07:01 -0400
committerBob Zeleznik <zzzman@gmail.com>2020-06-21 22:07:01 -0400
commit2e41227b586e6ad7f9f9f83154011ea33b27b38c (patch)
treef56a72696e3c85e1794aab818ecf6cc3b2851677 /src
parent884e1f73f6a3ff47d286b13ff58166b62026cc18 (diff)
fixed actions
Diffstat (limited to 'src')
-rw-r--r--src/client/views/collections/CollectionSchemaView.tsx61
1 files changed, 29 insertions, 32 deletions
diff --git a/src/client/views/collections/CollectionSchemaView.tsx b/src/client/views/collections/CollectionSchemaView.tsx
index 334897028..a79b790f5 100644
--- a/src/client/views/collections/CollectionSchemaView.tsx
+++ b/src/client/views/collections/CollectionSchemaView.tsx
@@ -770,7 +770,7 @@ export class SchemaTable extends React.Component<SchemaTableProps> {
return false;
}
-
+ @action
showDoc(doc: Doc | undefined, dataDoc?: Doc, screenX?: number, screenY?: number) {
this._showDoc = doc;
if (dataDoc && screenX && screenY) {
@@ -778,7 +778,6 @@ export class SchemaTable extends React.Component<SchemaTableProps> {
}
}
- @action
onOpenClick = () => {
if (this._showDoc) {
this.props.addDocTab(this._showDoc, "onRight");
@@ -790,38 +789,36 @@ export class SchemaTable extends React.Component<SchemaTableProps> {
}
render() {
-
const preview = "";
-
return <div className="collectionSchemaView-table" onPointerDown={this.onPointerDown} onWheel={e => this.props.active(true) && e.stopPropagation()} onDrop={e => this.props.onDrop(e, {})} onContextMenu={this.onContextMenu} >
- {this._showDoc ? <div onClick={() => { this.onOpenClick(); }} style={{
- position: "absolute", transform: `translate(${this._showDocPos[0]}, ${this._showDocPos[1]})`
- }}
- ref="overlay"><ContentFittingDocumentView
- Document={this._showDoc}
- DataDoc={this._showDataDoc}
- NativeHeight={returnZero}
- NativeWidth={returnZero}
- fitToBox={true}
- FreezeDimensions={true}
- focus={emptyFunction}
- LibraryPath={emptyPath}
- renderDepth={this.props.renderDepth}
- rootSelected={() => false}
- PanelWidth={() => 150}
- PanelHeight={() => 150}
- ScreenToLocalTransform={this.getPreviewTransform}
- docFilters={returnEmptyFilter}
- ContainingCollectionDoc={this.props.CollectionView?.props.Document}
- ContainingCollectionView={this.props.CollectionView}
- moveDocument={this.props.moveDocument}
- parentActive={this.props.active}
- whenActiveChanged={emptyFunction}
- addDocTab={this.props.addDocTab}
- pinToPres={this.props.pinToPres}
- bringToFront={returnFalse}
- ContentScaling={returnOne}>
- </ContentFittingDocumentView></div> : null}
+ {!this._showDoc ? (null) :
+ <div onClick={() => { this.onOpenClick(); }} style={{ position: "absolute", transform: `translate(${this._showDocPos[0]}, ${this._showDocPos[1]})` }}
+ ref="overlay"><ContentFittingDocumentView
+ Document={this._showDoc}
+ DataDoc={this._showDataDoc}
+ NativeHeight={returnZero}
+ NativeWidth={returnZero}
+ fitToBox={true}
+ FreezeDimensions={true}
+ focus={emptyFunction}
+ LibraryPath={emptyPath}
+ renderDepth={this.props.renderDepth}
+ rootSelected={() => false}
+ PanelWidth={() => 150}
+ PanelHeight={() => 150}
+ ScreenToLocalTransform={this.getPreviewTransform}
+ docFilters={returnEmptyFilter}
+ ContainingCollectionDoc={this.props.CollectionView?.props.Document}
+ ContainingCollectionView={this.props.CollectionView}
+ moveDocument={this.props.moveDocument}
+ parentActive={this.props.active}
+ whenActiveChanged={emptyFunction}
+ addDocTab={this.props.addDocTab}
+ pinToPres={this.props.pinToPres}
+ bringToFront={returnFalse}
+ ContentScaling={returnOne}>
+ </ContentFittingDocumentView>
+ </div>}
{this.reactTable}
<div className="collectionSchemaView-addRow" onClick={() => this.createRow()}>+ new</div>
</div>;