Skip to content
This repository has been archived by the owner on Mar 9, 2023. It is now read-only.

Commit

Permalink
Toggle lane direction by clicking
Browse files Browse the repository at this point in the history
  • Loading branch information
dabreegster committed Nov 7, 2022
1 parent 3938b12 commit 8710fc6
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions web_editor/js/cards.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,20 @@ function typeIcon(lane) {

function directionIcon(lane) {
if (lane.direction == "forward") {
return icon("forwards");
var obj = iconObj("forwards");
obj.onclick = () => {
lane.direction = "backward";
app.render();
};
return obj;
}
if (lane.direction == "backward") {
return icon("backwards");
var obj = iconObj("backwards");
obj.onclick = () => {
lane.direction = "forward";
app.render();
};
return obj;
}
if (lane.direction == "both") {
return icon("both_ways");
Expand Down

0 comments on commit 8710fc6

Please sign in to comment.