From ec993d1a9ba5f25af2852e18f6574898966b35ed Mon Sep 17 00:00:00 2001 From: Azgaar Date: Thu, 12 Sep 2024 12:55:31 +0200 Subject: [PATCH] fix: #1129 --- index.html | 2 +- modules/routes-generator.js | 5 +---- modules/ui/route-group-editor.js | 9 ++++----- versioning.js | 2 +- 4 files changed, 7 insertions(+), 11 deletions(-) diff --git a/index.html b/index.html index cd1112aa..931174f1 100644 --- a/index.html +++ b/index.html @@ -8098,7 +8098,7 @@ - + diff --git a/modules/routes-generator.js b/modules/routes-generator.js index 044f0cf4..edd41b4f 100644 --- a/modules/routes-generator.js +++ b/modules/routes-generator.js @@ -725,10 +725,7 @@ window.Routes = (function () { } pack.routes = pack.routes.filter(r => r.i !== route.i); - viewbox - .select("#routes") - .select("#route" + route.i) - .remove(); + viewbox.select("#route" + route.i).remove(); } return { diff --git a/modules/ui/route-group-editor.js b/modules/ui/route-group-editor.js index 370058c1..8450e299 100644 --- a/modules/ui/route-group-editor.js +++ b/modules/ui/route-group-editor.js @@ -18,7 +18,7 @@ function editRouteGroups() { // add listeners byId("routeGroupsEditorAdd").addEventListener("click", addGroup); byId("routeGroupsEditorBody").on("click", ev => { - const group = ev.target.parentNode.dataset.id; + const group = ev.target.closest(".states")?.dataset.id; if (ev.target.classList.contains("editStyle")) editStyle("routes", group); else if (ev.target.classList.contains("removeGroup")) removeGroup(group); }); @@ -72,12 +72,11 @@ function editRouteGroups() { confirmationDialog({ title: "Remove route group", message: - "Are you sure you want to remove the entire route group? All routes in this group will be removed. This action can't be reverted.", + "Are you sure you want to remove the entire route group? All routes in this group will be removed.
This action can't be reverted", confirm: "Remove", onConfirm: () => { - const routes = pack.routes.filter(r => r.group === group); - routes.forEach(r => Routes.remove(r)); - if (DEFAULT_GROUPS.includes(group)) routes.select(`#${group}`).remove(); + pack.routes.filter(r => r.group === group).forEach(Routes.remove); + if (!DEFAULT_GROUPS.includes(group)) routes.select(`#${group}`).remove(); addLines(); } }); diff --git a/versioning.js b/versioning.js index fe86508b..47719a09 100644 --- a/versioning.js +++ b/versioning.js @@ -12,7 +12,7 @@ * * Example: 1.102.2 -> Major version 1, Minor version 102, Patch version 2 */ -const VERSION = "1.103.7"; +const VERSION = "1.103.8"; if (parseMapVersion(VERSION) !== VERSION) alert("versioning.js: Invalid format or parsing function"); {