Skip to content
Snippets Groups Projects
Commit 8e3a4477 authored by Harm Kube's avatar Harm Kube
Browse files

Displaying links as a list

parent 4460c4ec
No related branches found
No related tags found
No related merge requests found
...@@ -302,10 +302,10 @@ ...@@ -302,10 +302,10 @@
} }
.neighbor-content-links { .neighbor-content-links {
padding: 0 18px; padding: 5px;
display: none; display: none;
overflow: hidden; overflow: hidden;
background-color: #000000; background-color: #ffffff;
flex-direction: row; flex-direction: column;
overflow-x: auto; overflow-x: auto;
} }
import * as Helpers from "../helpers"; import * as Helpers from "../helpers";
import jQuery from "jquery"; import jQuery from "jquery";
import * as Config from "../../config";
export { NodeNeighborOverlay }; export { NodeNeighborOverlay };
...@@ -41,7 +40,9 @@ class NodeNeighborOverlay { ...@@ -41,7 +40,9 @@ class NodeNeighborOverlay {
"neighbor-content-tabs", "neighbor-content-tabs",
bottomContainerDiv bottomContainerDiv
); );
coll.style.display = "flex";
this.contentTab = contentTabs; this.contentTab = contentTabs;
contentTabs.style.display = "flex";
coll.addEventListener("click", function() { coll.addEventListener("click", function() {
if(contentTabs.style.display === "flex") { if(contentTabs.style.display === "flex") {
contentTabs.style.display = "none"; contentTabs.style.display = "none";
...@@ -104,22 +105,10 @@ class NodeNeighborOverlay { ...@@ -104,22 +105,10 @@ class NodeNeighborOverlay {
*/ */
createReference(target) { createReference(target) {
const linkDiv = document.createElement("div"); const linkDiv = document.createElement("div");
linkDiv.className = "link-img"; var linkText = document.createTextNode("- " + target.name);
linkDiv.appendChild(linkText);
if ("image" in target) { linkDiv.style.margin = "2px";
const linkImage = document.createElement("img"); linkDiv.style.cursor = "pointer";
linkImage.src =
Config.PLUGIN_PATH + "datasets/images/" + target.image;
linkDiv.appendChild(linkImage);
}
if ("name" in target) {
Helpers.createHTMLElement("p", linkDiv, {
className: "bottom-container-link-text",
innerText: target.name,
});
}
jQuery(linkDiv).on("click", () => { jQuery(linkDiv).on("click", () => {
this.graph.focusOnNode(target); this.graph.focusOnNode(target);
this.infoOverlay.updateInfoOverlay(target); this.infoOverlay.updateInfoOverlay(target);
...@@ -133,10 +122,6 @@ class NodeNeighborOverlay { ...@@ -133,10 +122,6 @@ class NodeNeighborOverlay {
*/ */
updateTabs(node) { updateTabs(node) {
this.clearTabContentPages(); this.clearTabContentPages();
if(this.contentTab.style.display === "flex") {
this.contentTab.style.display = "none";
}
for (const link of node.links) { for (const link of node.links) {
const target = link.source == node ? link.target : link.source; const target = link.source == node ? link.target : link.source;
const reference = this.createReference(target); const reference = this.createReference(target);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment