From 0b798005fd4e917ecad4a961d638e1062f618d2c Mon Sep 17 00:00:00 2001
From: bobzel <zzzman@gmail.com>
Date: Tue, 1 Sep 2020 00:06:09 -0400
Subject: fixed shortcut buttons not showing up.  fixed nex/prev search buttons
 not showing up.  fixed search drag/delete/open buttons not showing up.

---
 src/client/views/MainView.tsx | 76 ++++++++++++++++++++-----------------------
 1 file changed, 36 insertions(+), 40 deletions(-)

(limited to 'src/client/views/MainView.tsx')

diff --git a/src/client/views/MainView.tsx b/src/client/views/MainView.tsx
index d479f0f78..4eccbaeb1 100644
--- a/src/client/views/MainView.tsx
+++ b/src/client/views/MainView.tsx
@@ -297,41 +297,40 @@ export class MainView extends React.Component {
     }
 
     @computed get flyout() {
-        return !this._sidebarContent || !this._flyoutWidth ? (null) :
-            <div className={`mainView-libraryFlyout${this._flyoutWidth ? "" : "-out"}`} style={{ minWidth: this._flyoutWidth, width: this._flyoutWidth }} >
-                <div className="mainView-contentArea" >
-                    <DocumentView
-                        Document={this._sidebarContent}
-                        DataDoc={undefined}
-                        LibraryPath={emptyPath}
-                        addDocument={undefined}
-                        addDocTab={this.addDocTabFunc}
-                        pinToPres={emptyFunction}
-                        NativeHeight={returnZero}
-                        NativeWidth={returnZero}
-                        rootSelected={returnTrue}
-                        removeDocument={returnFalse}
-                        onClick={undefined}
-                        ScreenToLocalTransform={this.mainContainerXf}
-                        ContentScaling={returnOne}
-                        PanelWidth={this.flyoutWidthFunc}
-                        PanelHeight={this.getContentsHeight}
-                        renderDepth={0}
-                        focus={emptyFunction}
-                        backgroundColor={this.defaultBackgroundColors}
-                        parentActive={returnTrue}
-                        whenActiveChanged={emptyFunction}
-                        bringToFront={emptyFunction}
-                        docFilters={returnEmptyFilter}
-                        searchFilterDocs={returnEmptyDoclist}
-                        ContainingCollectionView={undefined}
-                        ContainingCollectionDoc={undefined}
-                        relative={true}
-                        forcedBackgroundColor={() => "lightgrey"}
-                    />
-                </div>
-                {this.docButtons}
-            </div>;
+        return <div className={`mainView-libraryFlyout${this._flyoutWidth ? "" : "-out"}`} style={{ minWidth: this._flyoutWidth, width: this._flyoutWidth }} >
+            <div className="mainView-contentArea" >
+                <DocumentView
+                    Document={this._sidebarContent}
+                    DataDoc={undefined}
+                    LibraryPath={emptyPath}
+                    addDocument={undefined}
+                    addDocTab={this.addDocTabFunc}
+                    pinToPres={emptyFunction}
+                    NativeHeight={returnZero}
+                    NativeWidth={returnZero}
+                    rootSelected={returnTrue}
+                    removeDocument={returnFalse}
+                    onClick={undefined}
+                    ScreenToLocalTransform={this.mainContainerXf}
+                    ContentScaling={returnOne}
+                    PanelWidth={this.flyoutWidthFunc}
+                    PanelHeight={this.getContentsHeight}
+                    renderDepth={0}
+                    focus={emptyFunction}
+                    backgroundColor={this.defaultBackgroundColors}
+                    parentActive={returnTrue}
+                    whenActiveChanged={emptyFunction}
+                    bringToFront={emptyFunction}
+                    docFilters={returnEmptyFilter}
+                    searchFilterDocs={returnEmptyDoclist}
+                    ContainingCollectionView={undefined}
+                    ContainingCollectionDoc={undefined}
+                    relative={true}
+                    forcedBackgroundColor={() => "lightgrey"}
+                />
+            </div>
+            {this.docButtons}
+        </div>;
     }
 
     @computed get menuPanel() {
@@ -371,19 +370,16 @@ export class MainView extends React.Component {
     @action
     selectMenu = (button: Doc) => {
         const title = StrCast(Doc.GetProto(button).title);
-        if (this._panelContent === title && this._flyoutWidth) {
-            this.closeFlyout();
-        } else {
+        this.closeFlyout();
+        if (this._panelContent !== title || !this._flyoutWidth) {
             switch (this._panelContent = title) {
                 case "Settings":
                     SettingsManager.Instance.open();
-                    this.closeFlyout();
                     break;
                 case "Catalog":
                     SearchBox.Instance._searchFullDB = "My Stuff";
                     SearchBox.Instance.newsearchstring = "";
                     SearchBox.Instance.enter(undefined);
-                    this.closeFlyout();
                     break;
                 default:
                     this._sidebarContent.proto = button.target as any;
-- 
cgit v1.2.3-70-g09d2

