aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/collections/CollectionNoteTakingViewColumn.tsx
diff options
context:
space:
mode:
authorbobzel <zzzman@gmail.com>2024-04-10 21:02:05 -0400
committerbobzel <zzzman@gmail.com>2024-04-10 21:02:05 -0400
commit53fbe74037f03456a678d592d0ae5660c2f0d55e (patch)
treef961ca9a9527f548ad9037a6a750cd82a9053ec7 /src/client/views/collections/CollectionNoteTakingViewColumn.tsx
parentffb6621a7f822c3d605e4749b3f3be799ad1ef94 (diff)
more notetaking fixes - turn off autoSize, unobserve children. fixed typing a new note to delete placeholder text. added autoCreate for columns. added pivot column selector for notetaking view.
Diffstat (limited to 'src/client/views/collections/CollectionNoteTakingViewColumn.tsx')
-rw-r--r--src/client/views/collections/CollectionNoteTakingViewColumn.tsx4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/client/views/collections/CollectionNoteTakingViewColumn.tsx b/src/client/views/collections/CollectionNoteTakingViewColumn.tsx
index 788490b82..448b11b05 100644
--- a/src/client/views/collections/CollectionNoteTakingViewColumn.tsx
+++ b/src/client/views/collections/CollectionNoteTakingViewColumn.tsx
@@ -4,7 +4,6 @@ import { observer } from 'mobx-react';
import * as React from 'react';
import { lightOrDark, returnEmptyString } from '../../../Utils';
import { Doc, DocListCast, Opt } from '../../../fields/Doc';
-import { Id } from '../../../fields/FieldSymbols';
import { RichTextField } from '../../../fields/RichTextField';
import { listSpec } from '../../../fields/Schema';
import { SchemaHeaderField } from '../../../fields/SchemaHeaderField';
@@ -68,6 +67,7 @@ export class CollectionNoteTakingViewColumn extends ObservableReactComponent<CSV
// columnWidth returns the width of a column in absolute pixels
@computed get columnWidth() {
+ if (this._props.Document._notetaking_columns_autoSize) return this._props.availableWidth / (this._props.colHeaderData?.length || 1);
if (!this._props.colHeaderData || !this._props.headingObject || this._props.colHeaderData.length === 1) return `${(this._props.availableWidth / this._props.PanelWidth()) * 100}%`;
const i = this._props.colHeaderData.findIndex(hd => hd.heading === this._props.headingObject?.heading && hd.color === this._props.headingObject.color);
return ((this._props.colHeaderData[i].width * this._props.availableWidth) / this._props.PanelWidth()) * 100 + '%';
@@ -154,7 +154,7 @@ export class CollectionNoteTakingViewColumn extends ObservableReactComponent<CSV
deleteColumn = () => {
const colHdrData = Array.from(Cast(this._props.Document[this._props.fieldKey + '_columnHeaders'], listSpec(SchemaHeaderField), null));
if (this._props.headingObject) {
- this._props.docList.forEach(d => (d[this._props.pivotField] = undefined));
+ // this._props.docList.forEach(d => (d[DocData][this._props.pivotField] = undefined));
colHdrData.splice(colHdrData.indexOf(this._props.headingObject), 1);
this._props.resizeColumns(colHdrData);
}