diff options
| author | Bob Zeleznik <zzzman@gmail.com> | 2020-06-12 11:26:40 -0400 |
|---|---|---|
| committer | Bob Zeleznik <zzzman@gmail.com> | 2020-06-12 11:26:40 -0400 |
| commit | a16be30682d686e6588185a1104d268ae20c866d (patch) | |
| tree | 66c13d1699aad8515502ca28a81efd65b4f203c9 /src/client/views/collections/CollectionViewChromes.tsx | |
| parent | 57c7aea9cd91d8d13f6d6337c1842db8feb7b94b (diff) | |
fixed bug with initial position of CollectionGrid items. Added undo for changing GridView compaction
Diffstat (limited to 'src/client/views/collections/CollectionViewChromes.tsx')
| -rw-r--r-- | src/client/views/collections/CollectionViewChromes.tsx | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/client/views/collections/CollectionViewChromes.tsx b/src/client/views/collections/CollectionViewChromes.tsx index 64a459aff..459d98bb5 100644 --- a/src/client/views/collections/CollectionViewChromes.tsx +++ b/src/client/views/collections/CollectionViewChromes.tsx @@ -686,9 +686,9 @@ export class CollectionGridViewChrome extends React.Component<CollectionViewChro /** * Changes the value of the compactType */ - @undoBatch changeCompactType = (e: React.ChangeEvent<HTMLSelectElement>) => { - this.props.CollectionView.props.Document.gridCompaction = e.target.selectedOptions[0].value; + // need to change startCompaction so that this operation will be undoable. + this.props.CollectionView.props.Document.gridStartCompaction = e.target.selectedOptions[0].value; } render() { @@ -709,7 +709,7 @@ export class CollectionGridViewChrome extends React.Component<CollectionViewChro <input className="collectionGridViewChrome-entryBox" type="number" placeholder={this.props.CollectionView.props.Document.rowHeight as string} onKeyDown={this.onRowHeightEnter} onClick={(e: React.MouseEvent<HTMLInputElement, MouseEvent>) => { e.stopPropagation(); e.preventDefault(); e.currentTarget.focus(); }} /> </span> */} <span className="grid-control" style={{ width: this.resize ? "12%" : "20%" }}> - <input type="checkbox" style={{ marginRight: 5 }} onClick={this.toggleCollisions} defaultChecked={!this.props.CollectionView.props.Document.gridPreventCollision} /> + <input type="checkbox" style={{ marginRight: 5 }} onChange={this.toggleCollisions} checked={!this.props.CollectionView.props.Document.gridPreventCollision} /> <label className="flexLabel">{this.resize ? "Coll" : "Collisions"}</label> </span> @@ -717,7 +717,7 @@ export class CollectionGridViewChrome extends React.Component<CollectionViewChro style={{ marginRight: 5 }} onPointerDown={stopPropagation} onChange={this.changeCompactType} - value={StrCast(this.props.CollectionView.props.Document.gridCompaction)}> + value={StrCast(this.props.CollectionView.props.Document.gridStartCompaction, StrCast(this.props.CollectionView.props.Document.gridCompaction))}> {["vertical", "horizontal", "null"].map(type => <option className="collectionGridViewChrome-viewOption" onPointerDown={stopPropagation} @@ -728,7 +728,8 @@ export class CollectionGridViewChrome extends React.Component<CollectionViewChro </select> <span className="grid-control" style={{ width: this.resize ? "12%" : "20%" }}> - <input style={{ marginRight: 5 }} type="checkbox" onClick={this.toggleFlex} defaultChecked={BoolCast(this.props.CollectionView.props.Document.gridFlex, true)} /> + <input style={{ marginRight: 5 }} type="checkbox" onChange={this.toggleFlex} + checked={BoolCast(this.props.CollectionView.props.Document.gridFlex, true)} /> <label className="flexLabel">{this.resize ? "Flex" : "Flexible"}</label> </span> |
