diff --git a/tasks/enduro-trails/prototype/static/app.js b/tasks/enduro-trails/prototype/static/app.js index 292f7a1..095476d 100644 --- a/tasks/enduro-trails/prototype/static/app.js +++ b/tasks/enduro-trails/prototype/static/app.js @@ -450,6 +450,12 @@ function clearRoute() { function addWaypointMode() { if (routeWaypoints.length >= 10) return; + // Убедиться что routeMode активен — иначе клик на карте игнорируется + if (!routeMode) { + routeMode = true; + document.getElementById('tb-route').classList.add('active'); + updateMapModeClass(); + } addingWaypoint = true; window._map.getCanvas().style.cursor = 'crosshair'; document.getElementById('route-status').textContent = 'Тапни на карте для добавления точки'; @@ -673,6 +679,7 @@ function _initWaypointDragHandles(list) { list.addEventListener('mousedown', (e) => { const handle = e.target.closest('.wl-drag-handle'); if (!handle) return; + if (e.target.closest('.wl-add')) return; // не перехватывать кнопку добавления e.preventDefault(); startDrag(e.clientY, parseInt(handle.dataset.idx, 10)); document.addEventListener('mousemove', _onDragMouse);