aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/collections/CollectionStackingView.tsx
diff options
context:
space:
mode:
authorkimdahey <claire_kim1@brown.edu>2019-09-10 19:16:59 -0400
committerkimdahey <claire_kim1@brown.edu>2019-09-10 19:16:59 -0400
commit66d510b95c7e70049df6208dbe91ff4600058b27 (patch)
tree8cb061c2dc7b116c0ef4b8bf402c2928388260a3 /src/client/views/collections/CollectionStackingView.tsx
parent9b2562906bf3b87f18854dcaab9ad12b19dc3fce (diff)
parentec62b213439ab49134fa2dbbdf38a6d1ef5737cd (diff)
pulled from master
Diffstat (limited to 'src/client/views/collections/CollectionStackingView.tsx')
-rw-r--r--src/client/views/collections/CollectionStackingView.tsx4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/client/views/collections/CollectionStackingView.tsx b/src/client/views/collections/CollectionStackingView.tsx
index 97b31bf2a..654ff2279 100644
--- a/src/client/views/collections/CollectionStackingView.tsx
+++ b/src/client/views/collections/CollectionStackingView.tsx
@@ -310,6 +310,10 @@ export class CollectionStackingView extends CollectionSubView(doc => doc) {
sectionMasonry(heading: SchemaHeaderField | undefined, docList: Doc[]) {
let cols = Math.max(1, Math.min(docList.length,
Math.floor((this.props.PanelWidth() - 2 * this.xMargin) / (this.columnWidth + this.gridGap))));
+ if (isNaN(cols)) {
+ console.log("naN");
+ cols = 1;
+ }
return <div key={heading ? heading.heading : "empty"} className="collectionStackingView-masonrySection">
{!heading ? (null) :
<div key={`${heading.heading}`} className="collectionStackingView-sectionHeader" style={{ background: heading.color }}