diff options
author | bobzel <zzzman@gmail.com> | 2023-03-23 19:18:33 -0400 |
---|---|---|
committer | bobzel <zzzman@gmail.com> | 2023-03-23 19:18:33 -0400 |
commit | e4e1e346d2d0959336406edfda79c46b45787d25 (patch) | |
tree | 412e79dce8d34718737af8c6f01bd7bef5d6a531 /src | |
parent | 8cbe8e5a1375e9e762b4893a2af71e4b2d22f11d (diff) |
got rid of right resizer in schema view columns
Diffstat (limited to 'src')
3 files changed, 6 insertions, 18 deletions
diff --git a/src/client/views/collections/collectionSchema/CollectionSchemaView.scss b/src/client/views/collections/collectionSchema/CollectionSchemaView.scss index 55f320f14..769afbbf6 100644 --- a/src/client/views/collections/collectionSchema/CollectionSchemaView.scss +++ b/src/client/views/collections/collectionSchema/CollectionSchemaView.scss @@ -133,13 +133,6 @@ } } - .schema-column-resizer.right { - margin-left: 5px; - align-self: flex-end; - background-color: red; - display: none; - } - .schema-column-resizer.left { min-width: 5px; transform: translate(-3px, 0px); diff --git a/src/client/views/collections/collectionSchema/CollectionSchemaView.tsx b/src/client/views/collections/collectionSchema/CollectionSchemaView.tsx index d079bf839..28e0b07a4 100644 --- a/src/client/views/collections/collectionSchema/CollectionSchemaView.tsx +++ b/src/client/views/collections/collectionSchema/CollectionSchemaView.tsx @@ -238,25 +238,22 @@ export class CollectionSchemaView extends CollectionSubView() { }; @action - startResize = (e: any, index: number, left: boolean) => { + startResize = (e: any, index: number) => { this._displayColumnWidths = this.storedColumnWidths; - setupMoveUpEvents(this, e, (e, delta) => this.resizeColumn(e, index, left), this.finishResize, emptyFunction); + setupMoveUpEvents(this, e, (e, delta) => this.resizeColumn(e, index), this.finishResize, emptyFunction); }; @action - resizeColumn = (e: PointerEvent, index: number, left: boolean) => { + resizeColumn = (e: PointerEvent, index: number) => { if (this._displayColumnWidths) { let shrinking; let growing; let change = e.movementX; - if (left && index !== 0) { + if (index !== 0) { growing = change < 0 ? index : index - 1; shrinking = change < 0 ? index - 1 : index; - } else if (!left && index !== this.columnKeys.length - 1) { - growing = change > 0 ? index : index + 1; - shrinking = change > 0 ? index + 1 : index; } if (shrinking === undefined || growing === undefined) return true; diff --git a/src/client/views/collections/collectionSchema/SchemaColumnHeader.tsx b/src/client/views/collections/collectionSchema/SchemaColumnHeader.tsx index fffe0f4b4..cbdaeb933 100644 --- a/src/client/views/collections/collectionSchema/SchemaColumnHeader.tsx +++ b/src/client/views/collections/collectionSchema/SchemaColumnHeader.tsx @@ -14,7 +14,7 @@ export interface SchemaColumnHeaderProps { sortDesc: boolean; setSort: (field: string, desc: boolean) => void; removeColumn: (index: number) => void; - resizeColumn: (e: any, index: number, left: boolean) => void; + resizeColumn: (e: any, index: number) => void; dragColumn: (e: any, index: number) => boolean; openContextMenu: (x: number, y: number, index: number) => void; setColRef: (index: number, ref: HTMLDivElement) => void; @@ -51,7 +51,7 @@ export class SchemaColumnHeader extends React.Component<SchemaColumnHeaderProps> ref={(col: HTMLDivElement | null) => { col && this.props.setColRef(this.props.columnIndex, col); }}> - <div className="schema-column-resizer left" onPointerDown={e => this.props.resizeColumn(e, this.props.columnIndex, true)}></div> + <div className="schema-column-resizer left" onPointerDown={e => this.props.resizeColumn(e, this.props.columnIndex)}></div> <div className="schema-column-title">{this.fieldKey}</div> <div className="schema-header-menu"> @@ -62,8 +62,6 @@ export class SchemaColumnHeader extends React.Component<SchemaColumnHeaderProps> <FontAwesomeIcon icon="caret-right" style={this.props.sortField == this.fieldKey ? { transform: `rotate(${this.props.sortDesc ? '270deg' : '90deg'})` } : {}} /> </div> </div> - - <div className="schema-column-resizer right" onPointerDown={e => this.props.resizeColumn(e, this.props.columnIndex, false)}></div> </div> ); } |