refactor: drawMilitary

This commit is contained in:
Azgaar 2024-09-05 23:48:38 +02:00
parent e58cda2a5d
commit 0ea7e3a86d
12 changed files with 167 additions and 166 deletions

View file

@ -185,6 +185,7 @@ function restoreLayers() {
if (layerIsOn("toggleBorders")) drawBorders();
if (layerIsOn("toggleStates")) drawStates();
if (layerIsOn("toggleRivers")) drawRivers();
if (layerIsOn("toggleMilitary")) drawMilitary();
}
function toggleHeight(event) {
@ -824,11 +825,11 @@ function drawRoutes() {
function toggleMilitary(event) {
if (!layerIsOn("toggleMilitary")) {
turnButtonOn("toggleMilitary");
$("#armies").fadeIn();
drawMilitary();
if (event && isCtrlClick(event)) editStyle("armies");
} else {
if (event && isCtrlClick(event)) return editStyle("armies");
$("#armies").fadeOut();
armies.selectAll("g").remove();
turnButtonOff("toggleMilitary");
}
}