From f49f8427cd6dc6f9c6d14a3ac2976ffa23d64177 Mon Sep 17 00:00:00 2001 From: ljungster Date: Tue, 15 Mar 2022 16:43:36 -0400 Subject: pretty --- .../views/collections/CollectionNoteTakingView.tsx | 88 +++++++++++----------- 1 file changed, 44 insertions(+), 44 deletions(-) (limited to 'src') 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 { - 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 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 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 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() { -- cgit v1.2.3-70-g09d2