diff options
Diffstat (limited to 'src/client/views/collections/CollectionNoteTakingView.tsx')
-rw-r--r-- | src/client/views/collections/CollectionNoteTakingView.tsx | 27 |
1 files changed, 15 insertions, 12 deletions
diff --git a/src/client/views/collections/CollectionNoteTakingView.tsx b/src/client/views/collections/CollectionNoteTakingView.tsx index ff9e22ce1..5f9a4f4d0 100644 --- a/src/client/views/collections/CollectionNoteTakingView.tsx +++ b/src/client/views/collections/CollectionNoteTakingView.tsx @@ -66,7 +66,7 @@ export class CollectionNoteTakingView extends CollectionSubView<Partial<collecti @computed get xMargin() { return NumCast(this.layoutDoc._xMargin, 2 * Math.min(this.gridGap, .05 * this.props.PanelWidth())); } @computed get yMargin() { return this.props.yPadding || NumCast(this.layoutDoc._yMargin, 5); } // 2 * this.gridGap)); } @computed get gridGap() { return NumCast(this.layoutDoc._gridGap, 10); } - @computed get numGroupColumns() { return this.Sections.size; } + @computed get numGroupColumns() { return this.columnHeaders.length; } @computed get columnWidth() {return this.props.PanelWidth() - 2 * this.xMargin;} //-------------------------------------------- Parker's Playground --------------------------------------------// @@ -99,6 +99,7 @@ export class CollectionNoteTakingView extends CollectionSubView<Partial<collecti return docs.map((d, i) => { const height = () => this.getDocHeight(d); const width = () => this.getDocWidth(d); + //TODO change style here so that const style = { width: width(), marginTop: i ? this.gridGap : 0, height: height() }; return <div className={`collectionNoteTakingView-columnDoc`} key={d[Id]} style={style} > {this.getDisplayDoc(d, width)} @@ -291,7 +292,7 @@ export class CollectionNoteTakingView extends CollectionSubView<Partial<collecti return new Transform(- translateX + (dref?.centeringX || 0), - translateY + (dref?.centeringY || 0), 1).scale(this.props.ScreenToLocalTransform().Scale); } - //TODO do we actually want to update the doc width on this? + //TODO need to adjust so that we're basing off number of columns and dividers. getDocWidth(d: Doc) { const heading = d[this.pivotField] as object const castedSectionValue = heading.toString() @@ -326,15 +327,16 @@ export class CollectionNoteTakingView extends CollectionSubView<Partial<collecti } // This following three functions must be from the view Mehek showed - columnDividerDown = (e: React.PointerEvent) => { - runInAction(() => this._cursor = "grabbing"); - setupMoveUpEvents(this, e, this.onDividerMove, action(() => this._cursor = "grab"), emptyFunction); - } - @action - onDividerMove = (e: PointerEvent, down: number[], delta: number[]) => { - this.layoutDoc._columnWidth = Math.max(10, this.columnWidth + delta[0]); - return false; - } + // columnDividerDown = (e: React.PointerEvent) => { + // runInAction(() => this._cursor = "grabbing"); + // setupMoveUpEvents(this, e, this.onDividerMove, action(() => this._cursor = "grab"), emptyFunction); + // } + + // @action + // onDividerMove = (e: PointerEvent, down: number[], delta: number[]) => { + // this.layoutDoc._columnWidth = Math.max(10, this.columnWidth + delta[0]); + // return false; + // } //TODO: currently unused. How can we make use of it? // @computed get columnDragger() { @@ -498,6 +500,7 @@ export class CollectionNoteTakingView extends CollectionSubView<Partial<collecti return true; } + // TODO: need this, but not using atm @undoBatch @action //What is the difference between internal and external drop?? Does internal mean we're dropping inside of a collection? @@ -523,6 +526,7 @@ export class CollectionNoteTakingView extends CollectionSubView<Partial<collecti } }); } + // sections are important headings = () => Array.from(this.Sections); refList: any[] = []; @@ -629,7 +633,6 @@ export class CollectionNoteTakingView extends CollectionSubView<Partial<collecti // } } return eles - // return sections.map((section) => this.sectionNoteTaking(section[0], section[1])); } @computed get buttonMenu() { |