aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/client/views/collections/CollectionNoteTakingView.tsx18
-rw-r--r--src/client/views/collections/CollectionNoteTakingViewDivider.tsx10
2 files changed, 9 insertions, 19 deletions
diff --git a/src/client/views/collections/CollectionNoteTakingView.tsx b/src/client/views/collections/CollectionNoteTakingView.tsx
index 4bb16b01e..79e3c5f4b 100644
--- a/src/client/views/collections/CollectionNoteTakingView.tsx
+++ b/src/client/views/collections/CollectionNoteTakingView.tsx
@@ -303,12 +303,13 @@ export class CollectionNoteTakingView extends CollectionSubView<Partial<collecti
const heading = d[this.pivotField] as object
const castedSectionValue = heading.toString()
const existingHeader = this.columnHeaders.find(sh => sh.heading === (castedSectionValue));
+ const colStartXCoords = this.columnStartXCoords
if (existingHeader) {
const index = this.columnHeaders.indexOf(existingHeader)
if (this.columnHeaders.length == 1) {
- return this.props.PanelWidth() - this.columnStartXCoords[index] - 4 * this.gridGap - 100
+ return this.props.PanelWidth() - colStartXCoords[index] - 4 * this.gridGap - 100
}
- return this.columnStartXCoords[index + 1] - this.columnStartXCoords[index] - 2 * this.gridGap - 100
+ return colStartXCoords[index + 1] - colStartXCoords[index] - 2 * this.gridGap - 100
}
return 1000;
}
@@ -668,21 +669,10 @@ export class CollectionNoteTakingView extends CollectionSubView<Partial<collecti
//TODO make this look pretty
if (i < sections.length - 1) {
eles.push(
- // <div style={{display: "flex", alignItems: "center", cursor: "col-resize"}}>
- // <div className="columnDivider" onPointerOver={e => this.onDividerPointerOver(e, i)} key={i}
- // style={{
- // height: "95%",
- // width: 12,
- // borderRight: "4px solid #282828",
- // borderLeft: "4px solid #282828",
- // margin: "0px 10px"
- // }}
- // />
- // </div>
<CollectionNoteTakingViewDivider
index={i}
columnStartXCoords={this.columnStartXCoords}
- setColumnStartXCoords={this.setColumnStartXCoords}
+ setColumnStartXCoords={this.setColumnStartXCoords.bind(this)}
xMargin={this.xMargin}
/>
)
diff --git a/src/client/views/collections/CollectionNoteTakingViewDivider.tsx b/src/client/views/collections/CollectionNoteTakingViewDivider.tsx
index 3655c3f38..731ac556e 100644
--- a/src/client/views/collections/CollectionNoteTakingViewDivider.tsx
+++ b/src/client/views/collections/CollectionNoteTakingViewDivider.tsx
@@ -40,11 +40,11 @@ export default class Divider extends React.Component<DividerProps>{
// const xDividerPos = this.props.columnStartXCoords[this.props.index + 1] - 25
// const diff = xDividerPos - xPos
// // make a copy of the array
- const colXCoords : number[] = []
- this.props.columnStartXCoords.forEach(val => colXCoords.push(val))
- colXCoords[this.props.index + 1] += movementX
- this.props.setColumnStartXCoords(colXCoords)
- // console.log(this.props.columnStartXCoords)
+ // const colXCoords = [...this.props.columnStartXCoords]
+ // colXCoords[this.props.index + 1] += movementX
+ this.props.columnStartXCoords[this.props.index + 1] += movementX
+ // this.props.setColumnStartXCoords(colXCoords)
+ console.log(this.props.columnStartXCoords)
// this.props.columnStartXCoords = colXCoords
// }
}