Skip to content

Commit

Permalink
Fix theme problem for some colors
Browse files Browse the repository at this point in the history
  • Loading branch information
lkarlslund committed Jan 6, 2025
1 parent 2231d45 commit e563582
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions modules/frontend/html/graph.js
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ var cytostyle = [
return nodelabel(ele);
},
color: function (ele) {
return translateAutoTheme() == "dark" ? "white" : "black";
return translateAutoTheme(getpref("theme", "auto")) == "dark" ? "white" : "black";
},
"background-width": "80%",
"background-height": "80%",
Expand All @@ -297,7 +297,7 @@ var cytostyle = [
selector: "node.target",
style: {
"border-color": function (ele) {
return translateAutoTheme() == "dark" ? "white" : "black";
return translateAutoTheme(getpref("theme", "auto")) == "dark" ? "white" : "black";
},
"border-width": 3,
},
Expand Down Expand Up @@ -476,7 +476,7 @@ var cytostyle = [
// "text-rotation": "autorotate",
"text-justification": "center",
color: function (ele) {
return translateAutoTheme() == "dark" ? "white" : "black";
return translateAutoTheme(getpref("theme", "auto")) == "dark" ? "white" : "black";
},
"curve-style": "straight",
"target-arrow-shape": "triangle",
Expand Down Expand Up @@ -549,18 +549,20 @@ var cytostyle = [
selector: "node:selected",
style: {
"background-color": function (ele) {
return translateAutoTheme() == "dark" ? "white" : "grey";
return translateAutoTheme(getpref("theme", "auto")) == "dark" ? "white" : "grey";
},
},
},
{
selector: "edge:selected",
style: {
"target-arrow-color": function (ele) {
return translateAutoTheme() == "dark" ? "white" : "black";
return translateAutoTheme(getpref("theme", "auto")) == "dark"
? "white"
: "black";
},
"line-color": function (ele) {
return translateAutoTheme() == "dark" ? "white" : "black";
return translateAutoTheme(getpref("theme", "auto")) == "dark" ? "white" : "black";
},
width: 8,
},
Expand Down Expand Up @@ -1073,7 +1075,10 @@ function initgraph(data) {
}

function getEdgeColor(ele) {
color = translateAutoTheme() == "dark" ? "white" : "black";
color =
translateAutoTheme(getpref("theme", "auto")) == "dark"
? "white"
: "black";
if (ele.data("methods").includes("MemberOfGroup")) {
color = "orange";
} else if (ele.data("methods").includes("MemberOfGroupIndirect")) {
Expand Down

0 comments on commit e563582

Please sign in to comment.