Skip to content

Commit

Permalink
Fix the text hiding
Browse files Browse the repository at this point in the history
  • Loading branch information
MrHen committed Mar 31, 2016
1 parent f388c43 commit 7c3d5f6
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,9 @@ namespace LatinSquare {
update();
draw();

// Our helper classes will send back new entries after drawing in case extra
// setup is needed. We do our event handling here so the inner classes don't
// have to know about the draw/update details.
function draw() {
latinHive.drawLinks(links, cells);
latinHive.drawAxes(cells);
Expand All @@ -104,8 +107,6 @@ namespace LatinSquare {
draw();
})
.on("click", (cell) => {
console.log("cell debug", cell);

if (!cell.hint) {
cell.guess = (((cell.guess || 0) + 1) % (size + 1)) || null;

Expand Down Expand Up @@ -161,17 +162,16 @@ namespace LatinSquare {
link.solution.valid = valid;
});
}
}

let toggleOn = true;
function textToggle() {
toggleOn = !toggleOn;
d3.selectAll(".text").style("display", () => {
return toggleOn ? "block" : "none";
});

d3.selectAll(".chart").style("display", () => {
return toggleOn ? "block" : "inline-block";
});
}
let toggleOn = true;
function textToggle() {
toggleOn = !toggleOn;
d3.selectAll(".text").style("display", () => {
return toggleOn ? "block" : "none";
});

d3.selectAll(".chart").style("display", () => {
return toggleOn ? "block" : "inline-block";
});
}

0 comments on commit 7c3d5f6

Please sign in to comment.