From 158dd072d50d417b8d66038f6b42ae8935825ea8 Mon Sep 17 00:00:00 2001
From: Xiao Gui <xgui3783@gmail.com>
Date: Thu, 12 Mar 2020 23:51:34 +0100
Subject: [PATCH] chore: fix doc chore: remove console chore: added btn to
 collapse/expand layer browser

---
 docs/advanced/otherVolumes.md                 |  2 +-
 src/services/effect/newTemplate.effect.ts     |  1 -
 .../searchSideNav/searchSideNav.component.ts  |  2 ++
 src/ui/searchSideNav/searchSideNav.style.css  |  5 +++++
 .../searchSideNav/searchSideNav.template.html | 20 ++++++++++++++++---
 5 files changed, 25 insertions(+), 5 deletions(-)

diff --git a/docs/advanced/otherVolumes.md b/docs/advanced/otherVolumes.md
index 36a8254bb..b38f05425 100644
--- a/docs/advanced/otherVolumes.md
+++ b/docs/advanced/otherVolumes.md
@@ -1,7 +1,7 @@
 # Displaying non-atlas volumes
 
 !!! warning
-  This section is still been developed, and the content/API may change in future versions.
+    This section is still been developed, and the content/API may change in future versions.
 
 Interactive atlas can allow for arbitary volumes to be viewed, either in the context of a reference template or without. 
 
diff --git a/src/services/effect/newTemplate.effect.ts b/src/services/effect/newTemplate.effect.ts
index 102ac2443..d6b68b5d1 100644
--- a/src/services/effect/newTemplate.effect.ts
+++ b/src/services/effect/newTemplate.effect.ts
@@ -19,7 +19,6 @@ export class NewTemplateUseEffect{
   ){
     this.onNewTemplateShouldClearPreviewDataset$ = this.actions$.pipe(
       ofType(NEWVIEWER),
-      tap(() => console.log(`new`)),
       mapTo({
         type: DATASETS_ACTIONS_TYPES.CLEAR_PREVIEW_DATASETS
       })
diff --git a/src/ui/searchSideNav/searchSideNav.component.ts b/src/ui/searchSideNav/searchSideNav.component.ts
index 1bb7ce4a6..a2934c886 100644
--- a/src/ui/searchSideNav/searchSideNav.component.ts
+++ b/src/ui/searchSideNav/searchSideNav.component.ts
@@ -26,6 +26,8 @@ import { MatSnackBar } from "@angular/material/snack-bar";
 export class SearchSideNav implements OnDestroy {
   public availableDatasets: number = 0
 
+  public showLayerBrowser: boolean = true
+
   private subscriptions: Subscription[] = []
   private layerBrowserDialogRef: MatDialogRef<any>
 
diff --git a/src/ui/searchSideNav/searchSideNav.style.css b/src/ui/searchSideNav/searchSideNav.style.css
index 402871160..5d1650ffc 100644
--- a/src/ui/searchSideNav/searchSideNav.style.css
+++ b/src/ui/searchSideNav/searchSideNav.style.css
@@ -23,3 +23,8 @@ connectivity-browser {
 {
   min-height: 50vh!important;
 }
+
+.layerBrowserToggleBtn[toggle-open="true"]
+{
+  transform: translateY(-50%);
+}
diff --git a/src/ui/searchSideNav/searchSideNav.template.html b/src/ui/searchSideNav/searchSideNav.template.html
index 4628d6bc8..ff439458b 100644
--- a/src/ui/searchSideNav/searchSideNav.template.html
+++ b/src/ui/searchSideNav/searchSideNav.template.html
@@ -75,10 +75,24 @@
 </div>
 
 <ng-template #layerBrowserTmpl>
-  <mat-dialog-content>
-    <layer-browser></layer-browser>
+  <mat-dialog-content [hidden]="!showLayerBrowser">
+    <div class="d-flex flex-column">
+      <layer-browser></layer-browser>
+    </div>
   </mat-dialog-content>
-</ng-template>
+
+  <div class="d-flex justify-content-center position-static h-0 mt-4">
+    <button mat-mini-fab
+      [matBadge]="showLayerBrowser ? null : (layerBrowser.nonBaseNgLayers$ | async).length"
+      class="position-absolute layerBrowserToggleBtn"
+      matTooltip="Toggle the visiblity of the additional layer browser"
+      [attr.toggle-open]="showLayerBrowser"
+      (click)="showLayerBrowser = !showLayerBrowser">
+      <i class="fas" [ngClass]="{'fa-chevron-down': !showLayerBrowser, 'fa-chevron-up': showLayerBrowser}">
+      </i>
+    </button>
+  </div>
+</ng-template>  
 
 <!-- selected regions container -->
 <ng-template #selectedRegionsTmpl>
-- 
GitLab