diff options
author | bobzel <zzzman@gmail.com> | 2020-09-11 18:07:08 -0400 |
---|---|---|
committer | bobzel <zzzman@gmail.com> | 2020-09-11 18:07:08 -0400 |
commit | 1aacedfa3f558e243f2bca92c62fc0d0cfdce58a (patch) | |
tree | aafcbac134fdaccd8b26908d0fb40c12052eeff2 /src/client/views/collections/CollectionMenu.tsx | |
parent | 1b8eb5a59edfcef36e8f6450aca82de46d2044eb (diff) | |
parent | e3c8534e129a3ce70a2673c92cadccec26f6cdc7 (diff) |
Merge branch 'master' into bug_fixes
Diffstat (limited to 'src/client/views/collections/CollectionMenu.tsx')
-rw-r--r-- | src/client/views/collections/CollectionMenu.tsx | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/src/client/views/collections/CollectionMenu.tsx b/src/client/views/collections/CollectionMenu.tsx index cb989d348..f3ed89c78 100644 --- a/src/client/views/collections/CollectionMenu.tsx +++ b/src/client/views/collections/CollectionMenu.tsx @@ -251,7 +251,7 @@ export class CollectionViewBaseChrome extends React.Component<CollectionMenuProp } @computed get subChrome() { - switch (this.props.type) { + switch (this.props.docView.props.LayoutTemplateString ? CollectionViewType.Freeform : this.props.type) { // bcz: ARgh! hack to get menu for tree view outline items default: return this.otherSubChrome; case CollectionViewType.Invalid: case CollectionViewType.Freeform: return (<CollectionFreeFormViewChrome key="collchrome" {...this.props} isOverlay={this.props.type === CollectionViewType.Invalid} />); @@ -528,16 +528,14 @@ export class CollectionFreeFormViewChrome extends React.Component<CollectionMenu } @computed get selectedDocumentView() { - if (SelectionManager.SelectedDocuments().length) { - return SelectionManager.SelectedDocuments()[0]; - } else { return undefined; } + return SelectionManager.SelectedDocuments().length ? SelectionManager.SelectedDocuments()[0] : undefined; } @computed get selectedDoc() { return this.selectedDocumentView?.rootDoc; } @computed get isText() { if (this.selectedDoc) { const layoutField = Doc.LayoutField(this.selectedDoc); - return StrCast(layoutField).includes("FormattedText") || - (layoutField instanceof Doc && StrCast(layoutField.layout).includes("FormattedText")); + const layoutStr = this.selectedDocumentView?.props.LayoutTemplateString || StrCast(layoutField); + return layoutStr.includes("FormattedText") || StrCast((layoutField as Doc)?.layout).includes("FormattedText"); } else return false; } |