aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/collections/collectionSchema/SchemaRowBox.tsx
diff options
context:
space:
mode:
authormehekj <mehek.jethani@gmail.com>2022-10-24 15:06:47 -0400
committermehekj <mehek.jethani@gmail.com>2022-10-24 15:06:47 -0400
commit5425b61d62beef22d068e259ae3e2003f08e0c05 (patch)
tree6821bd8131032a7232f372ee5bbf16507138ff89 /src/client/views/collections/collectionSchema/SchemaRowBox.tsx
parent0b3a83acd4f75b7f6ff4b9bb7daf4377dede51a1 (diff)
switched drag element to show rows
Diffstat (limited to 'src/client/views/collections/collectionSchema/SchemaRowBox.tsx')
-rw-r--r--src/client/views/collections/collectionSchema/SchemaRowBox.tsx14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/client/views/collections/collectionSchema/SchemaRowBox.tsx b/src/client/views/collections/collectionSchema/SchemaRowBox.tsx
index 661056553..66cc3a47a 100644
--- a/src/client/views/collections/collectionSchema/SchemaRowBox.tsx
+++ b/src/client/views/collections/collectionSchema/SchemaRowBox.tsx
@@ -17,9 +17,9 @@ export interface SchemaRowBoxProps extends FieldViewProps {
columnKeys: string[];
columnWidths: number[];
rowMenuWidth: number;
- selectedRows: ObservableSet<Doc>;
- selectRow: (e: any, doc: Doc, index: number) => void;
- startDrag: (e: any, doc: Doc) => boolean;
+ selectedRows: ObservableMap<Doc, HTMLDivElement>;
+ selectRow: (e: any, doc: Doc, ref: HTMLDivElement, index: number) => void;
+ startDrag: (e: any, doc: Doc, ref: HTMLDivElement, index: number) => boolean;
dragging: boolean;
dropIndex: (index: number) => void;
}
@@ -42,9 +42,9 @@ export class SchemaRowBox extends ViewBoxBaseComponent<SchemaRowBoxProps>() {
setupMoveUpEvents(
this,
e,
- e => this.props.startDrag(e, this.props.Document),
+ e => this.props.startDrag(e, this.props.Document, this._ref!, this.props.rowIndex),
emptyFunction,
- e => this.props.selectRow(e, this.props.Document, this.props.rowIndex)
+ e => this.props.selectRow(e, this.props.Document, this._ref!, this.props.rowIndex)
);
};
@@ -96,7 +96,7 @@ export class SchemaRowBox extends ViewBoxBaseComponent<SchemaRowBoxProps>() {
ref={(row: HTMLDivElement | null) => (this._ref = row)}>
<div className="row-menu" style={{ width: this.props.rowMenuWidth }}>
<div
- className="row-button"
+ className="schema-row-button"
onPointerDown={undoBatch(e => {
e.stopPropagation();
this.props.removeDocument?.(this.props.Document);
@@ -104,7 +104,7 @@ export class SchemaRowBox extends ViewBoxBaseComponent<SchemaRowBoxProps>() {
<FontAwesomeIcon icon="times" />
</div>
<div
- className="row-button"
+ className="schema-row-button"
onPointerDown={e => {
e.stopPropagation();
this.props.addDocTab(this.props.Document, 'add:right');