This commit is contained in:
+10
-2
@@ -142,7 +142,7 @@
|
||||
|
||||
.route-control-actions {
|
||||
display: grid;
|
||||
grid-template-columns: 1fr;
|
||||
grid-template-columns: auto minmax(0, 1fr);
|
||||
gap: .5rem;
|
||||
margin-top: .85rem;
|
||||
padding-top: .75rem;
|
||||
@@ -171,7 +171,15 @@
|
||||
align-items: center;
|
||||
display: inline-flex;
|
||||
justify-content: center;
|
||||
font-weight: 700;
|
||||
min-height: 2.75rem;
|
||||
min-width: 2.75rem;
|
||||
padding: .5rem;
|
||||
}
|
||||
|
||||
.editor-button-icon {
|
||||
display: block;
|
||||
height: 1.65rem;
|
||||
width: 1.65rem;
|
||||
}
|
||||
|
||||
.editor-media-actions {
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32" fill="none">
|
||||
<path d="M11 29 14.2 3h3.6L21 29" stroke="white" stroke-width="2.8" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
<path d="M16 5v4m0 4v4m0 4v4" stroke="white" stroke-width="2.2" stroke-linecap="round"/>
|
||||
<path d="M7 29h18" stroke="white" stroke-width="2.8" stroke-linecap="round"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 370 B |
+3
-1
@@ -140,7 +140,9 @@
|
||||
<ul id="route-control-local-list" class="route-control-list" aria-live="polite"></ul>
|
||||
</section>
|
||||
<div class="route-control-actions">
|
||||
<button id="editor-button" class="editor-button" type="button" title="Streckenverwaltung öffnen" aria-haspopup="dialog" aria-expanded="false" aria-controls="editor-dialog">Strecken verwalten</button>
|
||||
<button id="editor-button" class="editor-button" type="button" aria-label="Streckenverwaltung öffnen" title="Streckenverwaltung öffnen" aria-haspopup="dialog" aria-expanded="false" aria-controls="editor-dialog">
|
||||
<img class="editor-button-icon" src="images/icons/route-management.svg" alt="" aria-hidden="true">
|
||||
</button>
|
||||
<button id="route-control-new" class="editor-primary-button" type="button">Neue lokale Strecke</button>
|
||||
</div>
|
||||
</nav>
|
||||
|
||||
@@ -336,7 +336,9 @@ globalThis.Wegwichtel = globalThis.Wegwichtel || {};
|
||||
const actions = document.createElement('div');
|
||||
actions.className = classes.iconRow;
|
||||
actions.appendChild(iconButton('Strecke bearbeiten', '✎', 'edit-route'));
|
||||
actions.appendChild(iconButton('Strecke löschen', '×', 'delete-route', false, true));
|
||||
if (routeSource(route) === 'local') {
|
||||
actions.appendChild(iconButton('Strecke löschen', '×', 'delete-route', false, true));
|
||||
}
|
||||
item.append(label, actions);
|
||||
return item;
|
||||
}
|
||||
@@ -1184,13 +1186,9 @@ globalThis.Wegwichtel = globalThis.Wegwichtel || {};
|
||||
|
||||
async function deleteRouteFromList(route) {
|
||||
const id = routeId(route);
|
||||
if (!id) return;
|
||||
if (!id || routeSource(route) !== 'local') return;
|
||||
|
||||
if (routeSource(route) === 'local') {
|
||||
ns.LocalRoutes.remove(id);
|
||||
} else {
|
||||
await sendDelete(`/routes/${encodeURIComponent(id)}`);
|
||||
}
|
||||
ns.LocalRoutes.remove(id);
|
||||
|
||||
if (routeId(state.currentRoute) === id && state.currentSource === routeSource(route)) {
|
||||
state.currentRoute = null;
|
||||
@@ -1214,7 +1212,9 @@ globalThis.Wegwichtel = globalThis.Wegwichtel || {};
|
||||
await loadRoute(route);
|
||||
return;
|
||||
}
|
||||
if (action === 'delete-route') await deleteRouteFromList(route);
|
||||
if (action === 'delete-route' && routeSource(route) === 'local') {
|
||||
await deleteRouteFromList(route);
|
||||
}
|
||||
}
|
||||
|
||||
async function deletePoiFromList(poi) {
|
||||
|
||||
Reference in New Issue
Block a user