aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/client/views/collections/CollectionNoteTakingView.tsx88
1 files changed, 44 insertions, 44 deletions
diff --git a/src/client/views/collections/CollectionNoteTakingView.tsx b/src/client/views/collections/CollectionNoteTakingView.tsx
index 9e16de327..8bccb0c0a 100644
--- a/src/client/views/collections/CollectionNoteTakingView.tsx
+++ b/src/client/views/collections/CollectionNoteTakingView.tsx
@@ -78,15 +78,15 @@ export class CollectionNoteTakingView extends CollectionSubView<StackingDocument
@computed get gridGap() { return NumCast(this.layoutDoc._gridGap, 10); }
// are we stacking or masonry?
//TODO: we might need to remove the notetaking view type
- @computed get isStackingView() { return (this.props.viewType ?? this.layoutDoc._viewType) === (CollectionViewType.Stacking || CollectionViewType.NoteTaking); }
+ @computed get isStackingView() { return ((this.props.viewType ?? this.layoutDoc._viewType) === CollectionViewType.Stacking) || ((this.props.viewType ?? this.layoutDoc._viewType) === CollectionViewType.NoteTaking); }
// this is the number of StackingViewFieldColumns that we have
- @computed get numGroupColumns() { return this.isStackingView ? Math.max(1, this.Sections.size + (this.showAddAGroup ? 1 : 0)) : 1; }
+ @computed get numGroupColumns() { return (this.isStackingView || CollectionViewType.NoteTaking)? Math.max(1, this.Sections.size + (this.showAddAGroup ? 1 : 0)) : 1; }
// reveals a button to add a group in masonry view
@computed get showAddAGroup() { return this.pivotField && !this.chromeHidden; }
// columnWidth handles the margin on the left and right side of the documents
@computed get columnWidth() {
return Math.min(this.props.PanelWidth() - 2 * this.xMargin,
- this.isStackingView ? Number.MAX_VALUE : this.layoutDoc._columnWidth === -1 ? this.props.PanelWidth() - 2 * this.xMargin : NumCast(this.layoutDoc._columnWidth, 250));
+ (this.isStackingView || CollectionViewType.NoteTaking) ? Number.MAX_VALUE : this.layoutDoc._columnWidth === -1 ? this.props.PanelWidth() - 2 * this.xMargin : NumCast(this.layoutDoc._columnWidth, 250));
}
@computed get NodeWidth() { return this.props.PanelWidth() - this.gridGap; }
@@ -545,46 +545,46 @@ export class CollectionNoteTakingView extends CollectionSubView<StackingDocument
}
// what a section looks like if we're in masonry. Shouldn't actually need to use this.
- sectionMasonry = (heading: SchemaHeaderField | undefined, docList: Doc[], first: boolean) => {
- const key = this.pivotField;
- let type: "string" | "number" | "bigint" | "boolean" | "symbol" | "undefined" | "object" | "function" | undefined = undefined;
- const types = docList.length ? docList.map(d => typeof d[key]) : this.filteredChildren.map(d => typeof d[key]);
- if (types.map((i, idx) => types.indexOf(i) === idx).length === 1) {
- type = types[0];
- }
- const rows = () => !this.isStackingView ? 1 : Math.max(1, Math.min(docList.length,
- Math.floor((this.props.PanelWidth() - 2 * this.xMargin) / (this.columnWidth + this.gridGap))));
- return <CollectionMasonryViewFieldRow
- showHandle={first}
- Document={this.props.Document}
- chromeHidden={this.chromeHidden}
- pivotField={this.pivotField}
- unobserveHeight={(ref) => this.refList.splice(this.refList.indexOf(ref), 1)}
- observeHeight={(ref) => {
- if (ref) {
- this.refList.push(ref);
- this.observer = new _global.ResizeObserver(action((entries: any) => {
- if (this.layoutDoc._autoHeight && ref && this.refList.length && !SnappingManager.GetIsDragging()) {
- const height = this.refList.reduce((p, r) => p + Number(getComputedStyle(r).height.replace("px", "")), 0);
- this.props.setHeight(this.headerMargin + height);
- }
- }));
- this.observer.observe(ref);
- }
- }}
- key={heading ? heading.heading : ""}
- rows={rows}
- headings={this.headings}
- heading={heading ? heading.heading : ""}
- headingObject={heading}
- docList={docList}
- parent={this}
- type={type}
- createDropTarget={this.createDashEventsTarget}
- screenToLocalTransform={this.props.ScreenToLocalTransform}
- setDocHeight={this.setDocHeight}
- />;
- }
+ // sectionMasonry = (heading: SchemaHeaderField | undefined, docList: Doc[], first: boolean) => {
+ // const key = this.pivotField;
+ // let type: "string" | "number" | "bigint" | "boolean" | "symbol" | "undefined" | "object" | "function" | undefined = undefined;
+ // const types = docList.length ? docList.map(d => typeof d[key]) : this.filteredChildren.map(d => typeof d[key]);
+ // if (types.map((i, idx) => types.indexOf(i) === idx).length === 1) {
+ // type = types[0];
+ // }
+ // const rows = () => !this.isStackingView ? 1 : Math.max(1, Math.min(docList.length,
+ // Math.floor((this.props.PanelWidth() - 2 * this.xMargin) / (this.columnWidth + this.gridGap))));
+ // return <CollectionMasonryViewFieldRow
+ // showHandle={first}
+ // Document={this.props.Document}
+ // chromeHidden={this.chromeHidden}
+ // pivotField={this.pivotField}
+ // unobserveHeight={(ref) => this.refList.splice(this.refList.indexOf(ref), 1)}
+ // observeHeight={(ref) => {
+ // if (ref) {
+ // this.refList.push(ref);
+ // this.observer = new _global.ResizeObserver(action((entries: any) => {
+ // if (this.layoutDoc._autoHeight && ref && this.refList.length && !SnappingManager.GetIsDragging()) {
+ // const height = this.refList.reduce((p, r) => p + Number(getComputedStyle(r).height.replace("px", "")), 0);
+ // this.props.setHeight(this.headerMargin + height);
+ // }
+ // }));
+ // this.observer.observe(ref);
+ // }
+ // }}
+ // key={heading ? heading.heading : ""}
+ // rows={rows}
+ // headings={this.headings}
+ // heading={heading ? heading.heading : ""}
+ // headingObject={heading}
+ // docList={docList}
+ // parent={this}
+ // type={type}
+ // createDropTarget={this.createDashEventsTarget}
+ // screenToLocalTransform={this.props.ScreenToLocalTransform}
+ // setDocHeight={this.setDocHeight}
+ // />;
+ // }
@action
// What are we adding a group to?
@@ -625,7 +625,7 @@ export class CollectionNoteTakingView extends CollectionSubView<StackingDocument
sections = this.layoutDoc._columnsSort ? entries.sort(this.sortFunc) : entries;
}
// a section will have a header and a list of docs. Ok cool.
- return sections.map((section, i) => this.isStackingView ? this.sectionStacking(section[0], section[1]) : this.sectionMasonry(section[0], section[1], i === 0));
+ return sections.map((section, i) => this.sectionStacking(section[0], section[1]));
}
@computed get buttonMenu() {