From 5949970b28342fa43de7e3a2c3825dba81f7c2b2 Mon Sep 17 00:00:00 2001
From: fsdavid <daviti1@mail.com>
Date: Mon, 6 May 2019 10:10:26 +0200
Subject: [PATCH] Correct #107 bug and show hiddent text in tooltip in context
 menu

---
 src/atlasViewer/atlasViewer.style.css            |  1 -
 src/atlasViewer/atlasViewer.template.html        |  5 ++++-
 ...ouseContextualContainerDirective.directive.ts | 16 +++++++++++-----
 3 files changed, 15 insertions(+), 7 deletions(-)

diff --git a/src/atlasViewer/atlasViewer.style.css b/src/atlasViewer/atlasViewer.style.css
index c182a1aa3..85941f1d2 100644
--- a/src/atlasViewer/atlasViewer.style.css
+++ b/src/atlasViewer/atlasViewer.style.css
@@ -130,7 +130,6 @@ div[contextualBlock]
 
 [fixedMouseContextualContainerDirective] div[body]
 {
-  background-color: blue;
   overflow: hidden;
 }
 
diff --git a/src/atlasViewer/atlasViewer.template.html b/src/atlasViewer/atlasViewer.template.html
index 6333de1ad..d868f7fda 100644
--- a/src/atlasViewer/atlasViewer.template.html
+++ b/src/atlasViewer/atlasViewer.template.html
@@ -27,7 +27,10 @@
         <div
           *ngIf="onhoverSegmentForFixed$ | async; let onhoverSegmentFixed"
           (click)="searchRegion([onhoverSegmentFixed])"
-          class="ws-no-wrap text-left pe-all btn btn-sm btn-secondary btn-block">
+          class="ws-no-wrap text-left pe-all btn btn-sm btn-secondary btn-block"
+          data-toggle="tooltip" 
+          data-placement="top" 
+          [title]="onhoverSegmentFixed.name">
           Search KG for {{ onhoverSegmentFixed.name }}
         </div>
 
diff --git a/src/util/directives/FixedMouseContextualContainerDirective.directive.ts b/src/util/directives/FixedMouseContextualContainerDirective.directive.ts
index 450dc8a00..6787cd257 100644
--- a/src/util/directives/FixedMouseContextualContainerDirective.directive.ts
+++ b/src/util/directives/FixedMouseContextualContainerDirective.directive.ts
@@ -1,4 +1,5 @@
 import { Directive, Input, HostBinding, HostListener, ElementRef, OnChanges, Output, EventEmitter } from "@angular/core";
+import { ConsoleReporter } from "jasmine";
 
 @Directive({
   selector: '[fixedMouseContextualContainerDirective]'
@@ -50,11 +51,16 @@ export class FixedMouseContextualContainerDirective implements OnChanges{
 
   @HostListener('document:click', ['$event'])
   documentClick(event: MouseEvent){
-    if (this.styleDisplay === 'none')
-      return
-    if (this.el.nativeElement.contains(event.target)) 
-      return
+    if (event.which !== 3) {
+      console.log(event.target);
+      console.log(event.which);
+      if (this.styleDisplay === 'none')
+        return
+      if (this.el.nativeElement.contains(event.target))
+        return
 
-    this.hide()
+      this.hide()
+    }
   }
+
 }
\ No newline at end of file
-- 
GitLab