From 1638527259a072dfc2ab286bd27bbb1751e8434e Mon Sep 17 00:00:00 2001 From: ljungster Date: Fri, 5 Aug 2022 08:30:35 -0500 Subject: stashing to look at master --- .../views/collections/CollectionNoteTakingView.tsx | 27 ++++++++++++++++++++-- .../collections/CollectionNoteTakingViewColumn.tsx | 4 ++++ 2 files changed, 29 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/client/views/collections/CollectionNoteTakingView.tsx b/src/client/views/collections/CollectionNoteTakingView.tsx index 9519e9aaa..3e2b8b762 100644 --- a/src/client/views/collections/CollectionNoteTakingView.tsx +++ b/src/client/views/collections/CollectionNoteTakingView.tsx @@ -74,7 +74,8 @@ export class CollectionNoteTakingView extends CollectionSubView([new SchemaHeaderField('New Column')]); this.columnStartXCoords = [0] // add all of the docs that have not been added to a column to this new column - } else { + } + else { const numHeaders = this.columnHeaders.length this.resizeColumns(numHeaders) } @@ -457,6 +458,27 @@ export class CollectionNoteTakingView extends CollectionSubView { + // if (!this.columnHeaders) { + // return + // } + // if (headingObject) { + // const index = this.columnHeaders.indexOf(headingObject); + // const newIndex = index == 0 ? 1 : index - 1 + // const newHeader = this.columnHeaders[newIndex]; + // docList.forEach(d => d[this.pivotField] = newHeader.heading.toString()) + // // this.props.columnHeaders.splice(index, 1); + // const newHeaders = this.columnHeaders; + // newHeaders.splice(index, 1); + // const test = this.layoutDoc._columnHeaders; + // this.columnHeaders = newHeaders; + // this.resizeColumns(newHeaders.length) + // } + // } + // when dropping outside of the current noteTaking context (like a new tab, freeform view, etc...) @undoBatch @action @@ -554,12 +576,13 @@ export class CollectionNoteTakingView extends CollectionSubView { if (value && this.columnHeaders) { - this.resizeColumns(this.columnHeaders.length + 1) const schemaHdrField = new SchemaHeaderField(value); this.columnHeaders.push(schemaHdrField); DocUtils.addFieldEnumerations(undefined, this.pivotField, [{ title: value, _backgroundColor: "schemaHdrField.color" }]); + this.resizeColumns(this.columnHeaders.length + 1) return true; } return false; diff --git a/src/client/views/collections/CollectionNoteTakingViewColumn.tsx b/src/client/views/collections/CollectionNoteTakingViewColumn.tsx index bdcb9c399..0ee5985bb 100644 --- a/src/client/views/collections/CollectionNoteTakingViewColumn.tsx +++ b/src/client/views/collections/CollectionNoteTakingViewColumn.tsx @@ -144,6 +144,7 @@ export class CollectionNoteTakingViewColumn extends React.Component { if (!this.props.columnHeaders) { return @@ -154,6 +155,9 @@ export class CollectionNoteTakingViewColumn extends React.Component d[this.props.pivotField] = newHeader.heading.toString()) this.props.columnHeaders.splice(index, 1); + // const newHeaders = this.props.columnHeaders; + // newHeaders.splice(index, 1); + // this.props.columnHeaders = newHeaders; this.props.resizeColumns(this.props.columnHeaders.length) } } -- cgit v1.2.3-70-g09d2