diff options
author | Bob Zeleznik <zzzman@gmail.com> | 2020-03-31 19:27:29 -0400 |
---|---|---|
committer | Bob Zeleznik <zzzman@gmail.com> | 2020-03-31 19:27:29 -0400 |
commit | f5b883ce67117c06e5d498746038aacb7dfb126c (patch) | |
tree | 2f3e8e1dcb99d70e3c3196b727ef82554ada6c35 /src | |
parent | 1fcaee2cd4453e214b51f0c74ad3f4481d5c4e9e (diff) |
fixed stacking view rendering of templates that treat regular docs like collections (eg slideView)
Diffstat (limited to 'src')
-rw-r--r-- | src/client/views/collections/CollectionStackingView.tsx | 2 | ||||
-rw-r--r-- | src/new_fields/Doc.ts | 3 |
2 files changed, 2 insertions, 3 deletions
diff --git a/src/client/views/collections/CollectionStackingView.tsx b/src/client/views/collections/CollectionStackingView.tsx index 9d5500e1a..086e0842e 100644 --- a/src/client/views/collections/CollectionStackingView.tsx +++ b/src/client/views/collections/CollectionStackingView.tsx @@ -63,7 +63,7 @@ export class CollectionStackingView extends CollectionSubView(doc => doc) { const rowSpan = Math.ceil((height() + this.gridGap) / this.gridGap); const style = this.isStackingView ? { width: width(), marginTop: this.gridGap, height: height() } : { gridRowEnd: `span ${rowSpan}` }; return <div className={`collectionStackingView-${this.isStackingView ? "columnDoc" : "masonryDoc"}`} key={d[Id]} ref={dref} style={style} > - {this.getDisplayDoc(d, this.props.DataDoc, dxf, width)} + {this.getDisplayDoc(d, (!d.isTemplateDoc && !d.isTemplateForField && !d.PARAMS) ? undefined : this.props.DataDoc, dxf, width)} </div>; }); } diff --git a/src/new_fields/Doc.ts b/src/new_fields/Doc.ts index 7fb17c788..25b526168 100644 --- a/src/new_fields/Doc.ts +++ b/src/new_fields/Doc.ts @@ -521,8 +521,7 @@ export namespace Doc { console.log("No, no, no!"); return { layout: childDoc, data: childDoc }; } - const existingResolvedDataDoc = childDoc[DataSym] !== Doc.GetProto(childDoc)[DataSym] && childDoc[DataSym]; - const resolvedDataDoc = existingResolvedDataDoc || (Doc.AreProtosEqual(containerDataDoc, containerDoc) || !containerDataDoc || (!childDoc.isTemplateDoc && !childDoc.isTemplateForField && !childDoc.PARAMS) ? undefined : containerDataDoc); + const resolvedDataDoc = (Doc.AreProtosEqual(containerDataDoc, containerDoc) || (!childDoc.isTemplateDoc && !childDoc.isTemplateForField && !childDoc.PARAMS) ? undefined : containerDataDoc); return { layout: Doc.expandTemplateLayout(childDoc, resolvedDataDoc, "(" + StrCast(containerDoc.PARAMS) + ")"), data: resolvedDataDoc }; } |