Skip to content

Commit

Permalink
refactor: rename .path class to .highlighted to prevent developer con…
Browse files Browse the repository at this point in the history
…fusion
  • Loading branch information
KonradHoeffner committed Jun 24, 2024
1 parent c5e3118 commit d17cdfa
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions css/graph.css
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ svg {
fill: rgb(200, 200, 100) !important;
}

.path .arrow-body {
.edge.highlighted .arrow-body {
stroke-width: 5px;
}
.path .arrow-head {
.edge.highlighted .arrow-head {
stroke: none !important;
fill: none !important;
}
Expand Down Expand Up @@ -66,6 +66,6 @@ svg {
stroke: gray;
}

.path .selected {
.edge.highlighted .selected {
stroke-width: 10px;
}
6 changes: 3 additions & 3 deletions js/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ function reset() {
const path = lastPath[i];
path.forEach((ele) => {
const domEle = document.getElementById(ele.id());
domEle.classList.remove("path");
domEle.classList.remove("highlighted");
const arrowBodyEle = document.getElementById(ele.id() + "ArrowBody");
if (arrowBodyEle) {
arrowBodyEle.classList.remove("path" + i);
Expand Down Expand Up @@ -129,7 +129,7 @@ function showPaths(validPaths, keep) {
const path = lastPath[i];
path.forEach((ele) => {
const domEle = document.getElementById(ele.id());
domEle.classList.remove("path");
domEle.classList.remove("highlighted");
const arrowBodyEle = document.getElementById(ele.id() + "ArrowBody");
if (arrowBodyEle) {
arrowBodyEle.classList.remove("path" + i);
Expand All @@ -152,7 +152,7 @@ function showPaths(validPaths, keep) {
const pathCount = (pathCounts.get(id) ?? -1) + 1;
pathCounts.set(id, pathCount);

domEle.classList.add("path");
domEle.classList.add("highlighted");
let arrowBodyEle = document.getElementById(id + "ArrowBody");
if (!arrowBodyEle) console.warn("cannot find arrow body of " + id);
let eventEle = arrowBodyEle;
Expand Down

0 comments on commit d17cdfa

Please sign in to comment.