diff --git a/src/atlasViewer/atlasViewer.template.html b/src/atlasViewer/atlasViewer.template.html index 1373f74d6e65fcd1e0c7b6d41651f3de5ae3c40a..a9a76fed238df732fa1a1976c22683ff7f5b32cf 100644 --- a/src/atlasViewer/atlasViewer.template.html +++ b/src/atlasViewer/atlasViewer.template.html @@ -84,7 +84,8 @@ <atlas-layer-selector #alSelector="atlasLayerSelector" class="pe-all" - (iav-outsideClick)="alSelector.selectorExpanded = false"> + (iav-outsideClick)="alSelector.selectorExpanded = false" + (closeAccordion)="uiNehubaContainer.accordionOpened = ''"> </atlas-layer-selector> <mat-chip-list class="mb-2"> <!-- additional layer --> diff --git a/src/ui/atlasLayerSelector/atlasLayerSelector.component.ts b/src/ui/atlasLayerSelector/atlasLayerSelector.component.ts index ff9f7a5bd781fb74be040ef9869b7c33d18dd8a8..822ed15ed4d6a99f9724ad4df0ba465fae1fbcd5 100644 --- a/src/ui/atlasLayerSelector/atlasLayerSelector.component.ts +++ b/src/ui/atlasLayerSelector/atlasLayerSelector.component.ts @@ -1,4 +1,4 @@ -import { Component, OnInit, ViewChildren, QueryList } from "@angular/core"; +import {Component, OnInit, ViewChildren, QueryList, Output, EventEmitter} from "@angular/core"; import { select, Store } from "@ngrx/store"; import { safeFilter } from "src/services/stateStore.service"; import { distinctUntilChanged, map, withLatestFrom, shareReplay, groupBy, mergeMap, toArray, switchMap, scan, tap, filter } from "rxjs/operators"; @@ -37,6 +37,8 @@ export class AtlasLayerSelector implements OnInit { public containerMaxWidth: number + @Output() public closeAccordion: EventEmitter<boolean> = new EventEmitter() + constructor(private store$: Store<any>) { this.selectedAtlas$ = this.store$.pipe( select(viewerStateGetSelectedAtlas), @@ -158,6 +160,7 @@ export class AtlasLayerSelector implements OnInit { } selectTemplateWithName(template) { + this.closeAccordion.emit() this.store$.dispatch({type: CLEAR_CONNECTIVITY_REGION}) this.store$.dispatch({type: SET_CONNECTIVITY_VISIBLE, payload: null}) this.store$.dispatch( diff --git a/src/ui/nehubaContainer/nehubaContainer.component.ts b/src/ui/nehubaContainer/nehubaContainer.component.ts index ff3b26f6a4a0ab5a91e42018590b80c48b8f2dbe..7a56478cd392f44b3ec629538d6645af3a3f5923 100644 --- a/src/ui/nehubaContainer/nehubaContainer.component.ts +++ b/src/ui/nehubaContainer/nehubaContainer.component.ts @@ -741,9 +741,7 @@ export class NehubaContainer implements OnInit, OnChanges, OnDestroy { this.subscriptions.push(this.selectedRegions$.subscribe(sr => { if (sr?.length >= 1) this.setConnectivityRegion(sr[0].name) else { - this.store.dispatch({type: CLEAR_CONNECTIVITY_REGION}) - this.store.dispatch({type: SET_CONNECTIVITY_VISIBLE, payload: null}) - if (this.accordionOpened === 'Connectivity') this.connectivityComponent.toggleConnectivityOnViewer(false) + this.disableConnectivity() } this.selectedRegions = sr })) @@ -816,6 +814,12 @@ export class NehubaContainer implements OnInit, OnChanges, OnDestroy { this.store.dispatch(viewerStateSetConnectivityRegion({ connectivityRegion: regionName })) } + public disableConnectivity() { + this.store.dispatch({type: CLEAR_CONNECTIVITY_REGION}) + this.store.dispatch({type: SET_CONNECTIVITY_VISIBLE, payload: null}) + if (this.accordionOpened === 'Connectivity') this.connectivityComponent.toggleConnectivityOnViewer(false) + } + sidebarAccordionOpened(title) { switch (title) { case 'Connectivity': {