diff options
| author | ljungster <parkerljung@gmail.com> | 2022-08-05 08:30:35 -0500 |
|---|---|---|
| committer | ljungster <parkerljung@gmail.com> | 2022-08-05 08:30:35 -0500 |
| commit | 1638527259a072dfc2ab286bd27bbb1751e8434e (patch) | |
| tree | 41e814ebef46cd62654a6851fce52f3dcc7a5d24 /src/client/views/collections/CollectionNoteTakingView.tsx | |
| parent | bb02d3a052efdbf25d1069059a92b7a9d9cc1708 (diff) | |
stashing to look at master
Diffstat (limited to 'src/client/views/collections/CollectionNoteTakingView.tsx')
| -rw-r--r-- | src/client/views/collections/CollectionNoteTakingView.tsx | 27 |
1 files changed, 25 insertions, 2 deletions
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<Partial<collecti this.layoutDoc._columnHeaders = new List<SchemaHeaderField>([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<Partial<collecti return true; } + // Used in CollectionNoteTakingView to delete a column when the user clicks the delete button + // @action + // @undoBatch + // deleteColumn = (headingObject: SchemaHeaderField | undefined, docList: Doc[]) => { + // 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<Partial<collecti // called when adding a new columnHeader @action + @undoBatch addGroup = (value: string) => { 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; |
