Skip to content
Snippets Groups Projects
Unverified Commit 1b8032a2 authored by xgui3783's avatar xgui3783 Committed by GitHub
Browse files

Merge pull request #7 from FZJ-INM1-BDA/dev_region_menu_action_naming

fix region menu
parents 3380b8b8 c2df7181
No related branches found
No related tags found
No related merge requests found
......@@ -116,7 +116,6 @@ export class AtlasViewer implements OnDestroy, OnInit, AfterViewInit {
public sidePanelIsOpen$: Observable<boolean>
public onhoverSegmentsForFixed$: Observable<string[]>
public regionToolsMenuVisible = false
constructor(
private store: Store<IavRootStoreInterface>,
......@@ -414,13 +413,11 @@ export class AtlasViewer implements OnDestroy, OnInit, AfterViewInit {
}
public mouseDownNehuba(_event) {
this.regionToolsMenuVisible = false
this.rClContextualMenu.hide()
}
public mouseUpNehuba(event) {
// if (this.mouseUpLeftPosition === event.pageX && this.mouseUpTopPosition === event.pageY) {}
this.regionToolsMenuVisible = true
if (!this.rClContextualMenu) { return }
this.rClContextualMenu.mousePos = [
event.clientX,
......
......@@ -142,14 +142,17 @@
<ng-container *ngFor="let onHoverRegion of onHoverSegments; let first = first">
<!-- ToDo it should change - we should get information about connectivity existence from API-->
<region-menu
class="pe-all"
[region]="onHoverRegion"
[isSelected]="selectedRegions$ | async | includes : onHoverRegion : compareFn"
[hasConnectivity]="selectedParcellation && selectedParcellation.hasAdditionalViewMode && selectedParcellation.hasAdditionalViewMode.includes('connectivity')"
>
</region-menu>
<div class="d-flex flex-column">
<region-menu
class="pe-all"
[region]="onHoverRegion"
[isSelected]="selectedRegions$ | async | includes : onHoverRegion : compareFn"
[hasConnectivity]="selectedParcellation
&& selectedParcellation.hasAdditionalViewMode
&& selectedParcellation.hasAdditionalViewMode.includes('connectivity')"
(closeRegionMenu)="rClContextualMenu.hide()">
</region-menu>
</div>
</ng-container>
</ng-container>
</div>
......
......@@ -17,7 +17,8 @@ export class RegionBase {
public isSelected: boolean = false
@Input() public hasConnectivity: boolean
@Output() public exploreConnectivity: EventEmitter<string> = new EventEmitter()
@Output() public closeRegionMenu: EventEmitter<boolean> = new EventEmitter()
constructor(
private store$: Store<IavRootStoreInterface>,
......@@ -26,6 +27,7 @@ export class RegionBase {
}
public navigateToRegion() {
this.closeRegionMenu.emit()
const { region } = this
this.store$.dispatch({
type: VIEWERSTATE_CONTROLLER_ACTION_TYPES.NAVIGATETO_REGION,
......@@ -34,6 +36,7 @@ export class RegionBase {
}
public toggleRegionSelected() {
this.closeRegionMenu.emit()
const { region } = this
this.store$.dispatch({
type: VIEWERSTATE_CONTROLLER_ACTION_TYPES.TOGGLE_REGION_SELECT,
......@@ -42,6 +45,7 @@ export class RegionBase {
}
public showConnectivity(regionName) {
this.closeRegionMenu.emit()
// ToDo trigger side panel opening with effect
this.store$.dispatch({type: OPEN_SIDE_PANEL})
this.store$.dispatch({type: EXPAND_SIDE_PANEL_CURRENT_VIEW})
......
......@@ -11,7 +11,7 @@
[color]="isSelected ? 'primary': 'basic'">
<i class="far" [ngClass]="{'fa-check-square': isSelected, 'fa-square': !isSelected}"></i>
<span>
Selected
{{isSelected? 'Deselect' : 'Select'}}
</span>
</button>
<button mat-button (click)="navigateToRegion()">
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment