aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorNathan-SR <144961007+Nathan-SR@users.noreply.github.com>2024-04-24 19:46:37 -0400
committerNathan-SR <144961007+Nathan-SR@users.noreply.github.com>2024-04-24 19:46:37 -0400
commit710832c7e6dcdb1b025bdfe931f6078ae2bc977a (patch)
tree1dda4de78ec57a0cedb443b0968ba5fe25fb0880 /src
parent8d88cb8828ba338f203b2e90486e16afe1f7de68 (diff)
column dragging visual update working (but kinda hacky)
Diffstat (limited to 'src')
-rw-r--r--src/client/views/collections/collectionSchema/CollectionSchemaView.tsx30
1 files changed, 9 insertions, 21 deletions
diff --git a/src/client/views/collections/collectionSchema/CollectionSchemaView.tsx b/src/client/views/collections/collectionSchema/CollectionSchemaView.tsx
index 710556c8a..d6d41c7c4 100644
--- a/src/client/views/collections/collectionSchema/CollectionSchemaView.tsx
+++ b/src/client/views/collections/collectionSchema/CollectionSchemaView.tsx
@@ -391,13 +391,13 @@ export class CollectionSchemaView extends CollectionSubView() {
this.childDocs.forEach(doc => dragEles.push(this._rowEles.get(doc).children[1].children[index]));
DragManager.StartColumnDrag(dragEles, dragData, e.x, e.y);
- document.removeEventListener('pointermove', this.highlightDropColumn);
- document.addEventListener('pointermove', this.highlightDropColumn);
- let stopHighlight = (e: PointerEvent) => {
- document.removeEventListener('pointermove', this.highlightDropColumn);
- document.removeEventListener('pointerup', stopHighlight);
- };
- document.addEventListener('pointerup', stopHighlight);
+ // document.removeEventListener('pointermove', this.highlightDropColumn);
+ // document.addEventListener('pointermove', this.highlightDropColumn);
+ // let stopHighlight = (e: PointerEvent) => {
+ // document.removeEventListener('pointermove', this.highlightDropColumn);
+ // document.removeEventListener('pointerup', stopHighlight);
+ // };
+ // document.addEventListener('pointerup', stopHighlight);
return true;
};
@@ -410,7 +410,7 @@ export class CollectionSchemaView extends CollectionSubView() {
else index = i + 1;
}
return total + curr;
- }, CollectionSchemaView._rowMenuWidth);
+ }, 2 * CollectionSchemaView._rowMenuWidth); //probably prone to issues; find better implementation (!!!)
return index;
};
@@ -565,19 +565,6 @@ export class CollectionSchemaView extends CollectionSubView() {
onInternalDrop = (e: Event, de: DragManager.DropEvent) => {
if (de.complete.columnDragData) {
- const mouseX = this.ScreenToLocalBoxXf().transformPoint(de.x, de.y)[0];
- const index = this.findColDropIndex(mouseX);
- this.moveColumn(de.complete.columnDragData.colIndex, index ?? de.complete.columnDragData.colIndex);
-
- this._colEles.forEach((colRef, i) => {
- colRef.style.borderLeft = '';
- colRef.style.borderRight = '';
- this.childDocs.forEach(doc => {
- this._rowEles.get(doc).children[1].children[i].style.borderLeft = '';
- this._rowEles.get(doc).children[1].children[i].style.borderRight = '';
- });
- });
-
this._colBeingDragged = false;
e.stopPropagation();
return true;
@@ -970,6 +957,7 @@ export class CollectionSchemaView extends CollectionSubView() {
let newIndex = this.findColDropIndex(e.clientX);
if (newIndex != this._draggedColIndex) this.moveColumn(this._draggedColIndex, newIndex ?? this._draggedColIndex);
this._draggedColIndex = newIndex ? newIndex : this._draggedColIndex;
+ console.log(newIndex)
}
}