diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/client/views/collections/CollectionMenu.tsx | 3 | ||||
-rw-r--r-- | src/client/views/collections/collectionGrid/CollectionGridView.tsx | 4 |
2 files changed, 4 insertions, 3 deletions
diff --git a/src/client/views/collections/CollectionMenu.tsx b/src/client/views/collections/CollectionMenu.tsx index eea8a3158..3c0f65ff8 100644 --- a/src/client/views/collections/CollectionMenu.tsx +++ b/src/client/views/collections/CollectionMenu.tsx @@ -985,6 +985,7 @@ export class CollectionGridViewChrome extends React.Component<CollectionMenuProp if (!this.decrementLimitReached) { this.entered && (this.document.gridNumCols as number)++; undoBatch(() => this.document.gridNumCols = this.numCols - 1)(); + if (this.numCols === 1) this.decrementLimitReached = true; } this.entered = false; } @@ -1036,7 +1037,7 @@ export class CollectionGridViewChrome extends React.Component<CollectionMenuProp render() { return ( <div className="collectionGridViewChrome-cont" > - <span className="grid-control" style={{ width: this.resize ? "25%" : "30%" }}> + <span className="grid-control" style={{ width: this.resize ? "25%" : "30%", color: "black" }}> <span className="grid-icon"> <FontAwesomeIcon icon="columns" size="1x" /> </span> diff --git a/src/client/views/collections/collectionGrid/CollectionGridView.tsx b/src/client/views/collections/collectionGrid/CollectionGridView.tsx index e6ac7021a..70ebca5e7 100644 --- a/src/client/views/collections/collectionGrid/CollectionGridView.tsx +++ b/src/client/views/collections/collectionGrid/CollectionGridView.tsx @@ -94,8 +94,8 @@ export class CollectionGridView extends CollectionSubView(GridSchema) { */ unflexedPosition(index: number): Omit<Layout, "i"> { return { - x: (index % Math.floor(this.numCols / this.defaultW)) * this.defaultW, - y: Math.floor(index / Math.floor(this.numCols / this.defaultH)) * this.defaultH, + x: (index % (Math.floor(this.numCols / this.defaultW) || 1)) * this.defaultW, + y: Math.floor(index / (Math.floor(this.numCols / this.defaultH) || 1)) * this.defaultH, w: this.defaultW, h: this.defaultH, static: true |