From 1677041ebb2e3f40af0c40a1d7ae25b2747c9b8d Mon Sep 17 00:00:00 2001
From: Matthias Konitzny <konitzny@ibr.cs.tu-bs.de>
Date: Tue, 3 Aug 2021 14:25:21 +0200
Subject: [PATCH] Added better visibility for toggled edge types.

---
 display/linkoverlay.js | 13 ++++++++++---
 kg-style.css           |  1 +
 2 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/display/linkoverlay.js b/display/linkoverlay.js
index b5f3d0f..5d0f084 100644
--- a/display/linkoverlay.js
+++ b/display/linkoverlay.js
@@ -20,9 +20,7 @@ class LinkOverlay {
             relation.className = 'relation';
             relation.edgeType = link;
             relation.innerHTML = "<p>" + link + "</p>";
-            jQuery(relation).click((event) =>
-                this.graph.toggleLinkVisibility(event.currentTarget.edgeType)
-            );
+            jQuery(relation).click((event) => this.toggleLinkVisibility(event));
             overlayNode.appendChild(relation);
 
             const colorStrip = document.createElement('div');
@@ -32,5 +30,14 @@ class LinkOverlay {
         }
     }
 
+    toggleLinkVisibility(event) {
+        const target = event.currentTarget;
+        this.graph.toggleLinkVisibility(target.edgeType)
+        if (getComputedStyle(target).opacity == 1.0) {
+            target.style.opacity = 0.4;
+        } else {
+            target.style.opacity = 1.0;
+        }
+    }
 
 }
\ No newline at end of file
diff --git a/kg-style.css b/kg-style.css
index 9cae946..3549aeb 100644
--- a/kg-style.css
+++ b/kg-style.css
@@ -141,6 +141,7 @@
     z-index: 100;
     cursor: pointer;
     pointer-events: all;
+    opacity: 1.0;
 }
 
 .rel-container {
-- 
GitLab