From adfc608f1d36b4da0a781dc2a6992a324c17a9b6 Mon Sep 17 00:00:00 2001
From: Xiao Gui <xgui3783@gmail.com>
Date: Wed, 25 Sep 2019 10:23:46 +0200
Subject: [PATCH] chore: mat-select show full menu content bugfix: hover
 segment info not working for segmentId > 65500 bugfix: dbl click on viewer
 not working for segId > 65500

---
 src/res/css/extra_styles.css                  |  7 +++-
 .../nehubaContainer.component.ts              |  5 ++-
 .../nehubaViewer/nehubaViewer.component.ts    | 37 ++++++++-----------
 .../viewerState.template.html                 |  2 +
 4 files changed, 26 insertions(+), 25 deletions(-)

diff --git a/src/res/css/extra_styles.css b/src/res/css/extra_styles.css
index 6fbc58d4c..69953526d 100644
--- a/src/res/css/extra_styles.css
+++ b/src/res/css/extra_styles.css
@@ -603,4 +603,9 @@ mat-icon[fontset="far"]
 .font-2x
 {
   font-size: 200%;
-}
\ No newline at end of file
+}
+
+.no-max-width
+{
+  max-width: none!important;
+}
diff --git a/src/ui/nehubaContainer/nehubaContainer.component.ts b/src/ui/nehubaContainer/nehubaContainer.component.ts
index 241907ecd..5aabb59ed 100644
--- a/src/ui/nehubaContainer/nehubaContainer.component.ts
+++ b/src/ui/nehubaContainer/nehubaContainer.component.ts
@@ -1,7 +1,7 @@
 import { Component, ViewChild, ViewContainerRef, ComponentFactoryResolver, ComponentFactory, ComponentRef, OnInit, OnDestroy, ElementRef } from "@angular/core";
 import { NehubaViewerUnit, computeDistance } from "./nehubaViewer/nehubaViewer.component";
 import { Store, select } from "@ngrx/store";
-import { ViewerStateInterface, safeFilter, CHANGE_NAVIGATION, isDefined, USER_LANDMARKS, ADD_NG_LAYER, REMOVE_NG_LAYER, NgViewerStateInterface, MOUSE_OVER_LANDMARK, SELECT_LANDMARKS, Landmark, PointLandmarkGeometry, PlaneLandmarkGeometry, OtherLandmarkGeometry, getNgIds, getMultiNgIdsRegionsLabelIndexMap, generateLabelIndexId, DataEntry } from "../../services/stateStore.service";
+import { ViewerStateInterface, safeFilter, CHANGE_NAVIGATION, isDefined, ADD_NG_LAYER, REMOVE_NG_LAYER, NgViewerStateInterface, MOUSE_OVER_LANDMARK, SELECT_LANDMARKS, Landmark, PointLandmarkGeometry, PlaneLandmarkGeometry, OtherLandmarkGeometry, getNgIds, getMultiNgIdsRegionsLabelIndexMap, generateLabelIndexId, DataEntry } from "src/services/stateStore.service";
 import { Observable, Subscription, fromEvent, combineLatest, merge, of } from "rxjs";
 import { filter,map, take, scan, debounceTime, distinctUntilChanged, switchMap, skip, withLatestFrom, buffer, tap, switchMapTo, shareReplay, mapTo, takeUntil } from "rxjs/operators";
 import { AtlasViewerAPIServices, UserLandmark } from "../../atlasViewer/atlasViewer.apiService.service";
@@ -656,8 +656,9 @@ export class NehubaContainer implements OnInit, OnDestroy{
                     : null)
             )
         }else{
-          if (this.nehubaViewer && this.nehubaViewer.removeSpatialSearch3DLandmarks instanceof Function)
+          if (this.nehubaViewer && this.nehubaViewer.removeSpatialSearch3DLandmarks instanceof Function) {
             this.nehubaViewer.removeSpatialSearch3DLandmarks()
+          }
         }
       })
     )
diff --git a/src/ui/nehubaContainer/nehubaViewer/nehubaViewer.component.ts b/src/ui/nehubaContainer/nehubaViewer/nehubaViewer.component.ts
index 632afe959..7a5ea161b 100644
--- a/src/ui/nehubaContainer/nehubaViewer/nehubaViewer.component.ts
+++ b/src/ui/nehubaContainer/nehubaViewer/nehubaViewer.component.ts
@@ -1,15 +1,16 @@
 import { Component, OnDestroy, Output, EventEmitter, ElementRef, NgZone, Renderer2 } from "@angular/core";
-import 'third_party/export_nehuba/main.bundle.js'
-import 'third_party/export_nehuba/chunk_worker.bundle.js'
-import { fromEvent, interval, Observable, Subscription } from 'rxjs'
-import { AtlasWorkerService } from "../../../atlasViewer/atlasViewer.workerService.service";
-import { buffer, map, filter, debounceTime, take, takeUntil, scan, switchMap, takeWhile } from "rxjs/operators";
-import { AtlasViewerConstantsServices } from "../../../atlasViewer/atlasViewer.constantService.service";
-import { takeOnePipe, identifySrcElement } from "../nehubaContainer.component";
+import { fromEvent, interval, Subscription } from 'rxjs'
+import { AtlasWorkerService } from "src/atlasViewer/atlasViewer.workerService.service";
+import { buffer, map, filter, debounceTime } from "rxjs/operators";
+import { AtlasViewerConstantsServices } from "src/atlasViewer/atlasViewer.constantService.service";
+import { takeOnePipe } from "../nehubaContainer.component";
 import { ViewerConfiguration } from "src/services/state/viewerConfig.store";
 import { pipeFromArray } from "rxjs/internal/util/pipe";
 import { getNgIdLabelIndexFromId } from "src/services/stateStore.service";
 
+import 'third_party/export_nehuba/main.bundle.js'
+import 'third_party/export_nehuba/chunk_worker.bundle.js'
+
 /**
  * no selector is needed, as currently, nehubaviewer is created dynamically
  */
@@ -725,21 +726,13 @@ export class NehubaViewerUnit implements OnDestroy{
     this._s8$ = this.nehubaViewer.mouseOver.segment.subscribe(({segment: segmentId, layer, ...rest})=>{
       
       const {name = 'unnamed'} = layer
-      if( segmentId && segmentId < 65500 ) {
-        const map = this.multiNgIdsLabelIndexMap.get(name)
-        const region = map && map.get(segmentId)
-        this.mouseoverSegmentEmitter.emit({
-          layer,
-          segment: region,
-          segmentId
-        })
-      }else{
-        this.mouseoverSegmentEmitter.emit({
-          layer,
-          segment: null,
-          segmentId
-        })
-      }
+      const map = this.multiNgIdsLabelIndexMap.get(name)
+      const region = map && map.get(segmentId)
+      this.mouseoverSegmentEmitter.emit({
+        layer,
+        segment: region,
+        segmentId
+      })
     })
 
     // nehubaViewer.navigationState.all emits every time a new layer is added or removed from the viewer
diff --git a/src/ui/viewerStateController/viewerState.template.html b/src/ui/viewerStateController/viewerState.template.html
index 52fdf3a93..b70d3e378 100644
--- a/src/ui/viewerStateController/viewerState.template.html
+++ b/src/ui/viewerStateController/viewerState.template.html
@@ -9,6 +9,7 @@
           Template
         </mat-label>
         <mat-select
+          panelClass="no-max-width"
           [value]="(templateSelected$ | async)?.name"
           (selectionChange)="handleTemplateChange($event)"
           (openedChange)="focused = $event">
@@ -71,6 +72,7 @@
           Parcellation
         </mat-label>
         <mat-select
+          panelClass="no-max-width"
           (selectionChange)="handleParcellationChange($event)"
           [value]="(parcellationSelected$ | async)?.name"
           (openedChange)="focused = $event">
-- 
GitLab