From 642be6f52df6484f25fd7c1940e4e290a5b6d118 Mon Sep 17 00:00:00 2001
From: bobzel <zzzman@gmail.com>
Date: Mon, 3 Aug 2020 11:55:09 -0400
Subject: fixed novice toolbar not to have buttonizablecommands for
 non-collections.

---
 src/client/views/collections/CollectionMenu.tsx | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

(limited to 'src/client/views/collections/CollectionMenu.tsx')

diff --git a/src/client/views/collections/CollectionMenu.tsx b/src/client/views/collections/CollectionMenu.tsx
index 8c4118e89..660b9f4df 100644
--- a/src/client/views/collections/CollectionMenu.tsx
+++ b/src/client/views/collections/CollectionMenu.tsx
@@ -344,9 +344,11 @@ export class CollectionViewBaseChrome extends React.Component<CollectionMenuProp
         } else { return undefined; }
     }
     @computed get selectedDoc() { return this.selectedDocumentView?.rootDoc; }
-    @computed get isText() {
+    @computed get notACollection() {
         if (this.selectedDoc) {
-            return this.selectedDoc[Doc.LayoutFieldKey(this.selectedDoc)] instanceof RichTextField;
+            const layoutField = Doc.LayoutField(this.selectedDoc);
+            return this.props.type === CollectionViewType.Docking ||
+                typeof (layoutField) === "string" && !layoutField?.includes("CollectionView");
         }
         else return false;
     }
@@ -356,9 +358,8 @@ export class CollectionViewBaseChrome extends React.Component<CollectionMenuProp
             <div className="collectionMenu-cont" >
                 <div className="collectionMenu">
                     <div className="collectionViewBaseChrome">
-                        {this.props.type === CollectionViewType.Invalid ||
-                            this.props.type === CollectionViewType.Docking || this.isText ? (null) : this.viewModes}
-                        {this.props.type === CollectionViewType.Docking || (this.isText && Doc.UserDoc().noviceMode) ? (null) : this.templateChrome}
+                        {this.notACollection || this.props.type === CollectionViewType.Invalid ? (null) : this.viewModes}
+                        {this.notACollection && Doc.UserDoc().noviceMode ? (null) : this.templateChrome}
                         {Doc.UserDoc().noviceMode ? (null) :
                             <Tooltip title={<div className="dash-tooltip">filter documents to show</div>} placement="bottom">
                                 <div className="collectionViewBaseChrome-viewSpecs" style={{ display: "grid" }}>
-- 
cgit v1.2.3-70-g09d2

