Skip to content

Commit

Permalink
fix: Down viz doesn't work if other trail views are active
Browse files Browse the repository at this point in the history
  • Loading branch information
HEmile committed Jan 16, 2022
1 parent 52d2218 commit fe9505a
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions src/Visualisations/Juggl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,10 @@ export function createJugglTrail(

const sectDiv = document.createElement("div");
sectDiv.addClass("cy-toolbar-section");
toolbarDiv.appendChild(sectDiv)
toolbarDiv.appendChild(sectDiv);

const amtChildren = target.children.length;

let jugglUp: IJuggl = null;
let jugglDown: IJuggl = null;

Expand All @@ -193,10 +196,10 @@ export function createJugglTrail(
icon: "↑",
onClick: () => {
if (jugglUp) {
target.children[1].classList.remove("juggl-hide")
target.children[amtChildren].classList.remove("juggl-hide")
}
if (jugglDown) {
target.children[2].classList.add("juggl-hide");
target.children[amtChildren + 1].classList.add("juggl-hide");
}
},
disabled: false,
Expand All @@ -209,9 +212,9 @@ export function createJugglTrail(
icon: "↓",
onClick: () => {
if (jugglDown) {
target.children[2].classList.remove("juggl-hide");
target.children[amtChildren + 1].classList.remove("juggl-hide");
if (jugglUp) {
target.children[1].classList.add("juggl-hide");
target.children[amtChildren].classList.add("juggl-hide");
}
return;
}
Expand All @@ -235,7 +238,7 @@ export function createJugglTrail(
jugglDown = createJuggl(plugin, target, nodes, args);

if (jugglUp) {
target.children[1].addClass("juggl-hide")
target.children[amtChildren].addClass("juggl-hide")
}
zoomToSource(jugglDown, source);
},
Expand Down

0 comments on commit fe9505a

Please sign in to comment.