aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/client/views/collections/CollectionNoteTakingView.tsx25
-rw-r--r--src/client/views/collections/CollectionNoteTakingViewColumn.tsx1
2 files changed, 21 insertions, 5 deletions
diff --git a/src/client/views/collections/CollectionNoteTakingView.tsx b/src/client/views/collections/CollectionNoteTakingView.tsx
index e0c79a265..c07473ee1 100644
--- a/src/client/views/collections/CollectionNoteTakingView.tsx
+++ b/src/client/views/collections/CollectionNoteTakingView.tsx
@@ -44,8 +44,8 @@ export type collectionNoteTakingViewProps = {
export class CollectionNoteTakingView extends CollectionSubView<Partial<collectionNoteTakingViewProps>>() {
_disposers: { [key: string]: IReactionDisposer } = {};
_masonryGridRef: HTMLDivElement | null = null;
- _draggerRef = React.createRef<HTMLDivElement>();
- @observable columnStartXCoords: number[] = [];
+ _draggerRef = React.createRef<HTMLDivElement>(); // change to relative widths for deleting. change storage from columnStartXCoords to columnHeaders (schemaHeaderFields has a widgth alrady)
+ @observable columnStartXCoords: number[] = []; // columnHeaders -- SchemaHeaderField -- widht
@observable docsDraggedRowCol: number[] = [];
@observable _cursor: CursorProperty = 'grab';
@observable _scroll = 0; // used to force the document decoration to update when scrolling
@@ -58,6 +58,22 @@ export class CollectionNoteTakingView extends CollectionSubView<Partial<collecti
const needsUnsetCategory = docs.some(d => {
return !d[this.notetakingCategoryField] && !columnHeaders.find(sh => sh.heading === 'unset');
});
+
+ // @#Oberable draggedColIndex = ...
+ //@observable cloneDivXYcoords
+ // @observable clonedDiv...
+
+ // render() {
+ // { this.clonedDiv ? <div clone styule={{transform: clonedDivXYCoords}} : null}
+ // }
+
+ // in NoteatakinView Column code, add a poinerDown handler that calls setupMoveUpEvents() which will clone the column div
+ // and re-render it under the cursor during move events.
+ // that move move event will update 2 observales -- the draggedColIndex up above, and the location of the clonedDiv so that the render in this view will know where to render the cloned div
+ // add observable variable that tells drag column to rnder in a different location than where the schemaHeaderFiel sa y ot.
+ // if (col 1 is where col 3) {
+ // return 3 2 1 4 56
+ // }
if (needsUnsetCategory) {
columnHeaders.push(new SchemaHeaderField('unset'));
}
@@ -98,8 +114,6 @@ export class CollectionNoteTakingView extends CollectionSubView<Partial<collecti
if (this.columnHeaders === undefined) {
this.dataDoc.columnHeaders = new List<SchemaHeaderField>([new SchemaHeaderField('New Column')]);
// add all of the docs that have not been added to a column to this new column
- } else {
- this.resizeColumns(this.columnHeaders.length);
}
}
@@ -573,6 +587,7 @@ export class CollectionNoteTakingView extends CollectionSubView<Partial<collecti
};
// called when adding a new columnHeader
+ @undoBatch
@action
addGroup = (value: string) => {
if (value && this.columnHeaders) {
@@ -618,7 +633,7 @@ export class CollectionNoteTakingView extends CollectionSubView<Partial<collecti
// sections = this.layoutDoc._columnsSort ? entries.sort(this.sortFunc) : entries;
// }
const entries = Array.from(this.Sections.entries());
- const sections = entries.sort(this.sortFunc);
+ const sections = entries; //.sort(this.sortFunc);
const eles: JSX.Element[] = [];
for (let i = 0; i < sections.length; i++) {
const col = this.sectionNoteTaking(sections[i][0], sections[i][1]);
diff --git a/src/client/views/collections/CollectionNoteTakingViewColumn.tsx b/src/client/views/collections/CollectionNoteTakingViewColumn.tsx
index 9b7518c60..62d954b9c 100644
--- a/src/client/views/collections/CollectionNoteTakingViewColumn.tsx
+++ b/src/client/views/collections/CollectionNoteTakingViewColumn.tsx
@@ -47,6 +47,7 @@ interface CSVFieldColumnProps {
screenToLocalTransform: () => Transform;
observeHeight: (myref: any) => void;
unobserveHeight: (myref: any) => void;
+ //setDraggedCol:(clonedDiv:any, header:SchemaHeaderField, xycoors: )
editableViewProps: () => any;
resizeColumns: (n: number) => void;
columnStartXCoords: number[];