Fixed 'Add Section' button to properly activate drawing mode
Deploy TrassenPlaner / deploy (push) Waiting to run Details

This commit is contained in:
Johannes Baumeister 2026-04-15 22:05:50 +02:00
parent 60eadc4d38
commit 0e5c3cb674
1 changed files with 15 additions and 2 deletions

View File

@ -2191,8 +2191,21 @@
// --- Variant Management UI ---
window.startNewPath = (id) => {
const layer = routeLayers[id];
if (layer && layer.editor) {
layer.editor.newPath();
if (layer) {
// Activate drawing state
state.isDrawing = true;
state.isMeasuring = false;
updateToolCursors();
// Ensure edit mode is on
if (!layer.editor) layer.enableEdit();
// Trigger new path drawing
if (layer.editor) {
layer.editor.newPath();
} else {
console.error("Editor not found on layer", id);
}
}
};