Fixes #11
CI / build-and-test (pull_request) Successful in 1m15s

- Fix dashboard draggin: introduced sophistaced drag handle
- Fix disappearing of charts when dragged inside a dashboard widget
This commit is contained in:
Pit Friedrich
2026-07-26 14:05:11 +02:00
parent 6bd81ff561
commit 9311d494bd
9 changed files with 108 additions and 5 deletions
@@ -146,6 +146,47 @@ vaadin-app-layout::part(content) {
box-shadow: none;
}
/* Drag grip: gridstack drags items by this element only (`handle` option in
GridStackLayout), so the item body keeps its own interactivity. The item
itself is absolutely positioned by gridstack, so it is the offset parent. */
.dialect-drag-handle {
position: absolute;
top: 14px;
right: 16px;
z-index: 1;
display: flex;
align-items: center;
justify-content: center;
width: 28px;
height: 28px;
border-radius: 6px;
color: var(--dialect-ink);
opacity: 0;
cursor: grab;
transition: opacity 120ms ease;
}
.grid-stack-item:hover > .dialect-drag-handle,
.dialect-drag-handle:focus-visible {
opacity: 0.65;
}
.dialect-drag-handle:active {
cursor: grabbing;
opacity: 1;
}
/* Touch devices never hover — keep the grip permanently visible there. */
@media (pointer: coarse) {
.dialect-drag-handle {
opacity: 0.65;
}
}
.grid-stack-item[gs-no-move] > .dialect-drag-handle {
display: none;
}
.grid-stack-item-content .ui-resizable-handle {
background: var(--dialect-primary);
opacity: 0.6;
@@ -24,7 +24,7 @@ card.registration=Registrierung
card.employees=Mitarbeiter
card.gridstackHint=Bedienung
gridstack.hint=Karten am Titel greifen und verschieben, an der unteren rechten Ecke die Größe ändern. Das Layout wird im Browser gespeichert und beim nächsten Besuch wiederhergestellt.
gridstack.hint=Karten am Griff oben rechts verschieben, an der unteren rechten Ecke die Größe ändern. Das Layout wird im Browser gespeichert und beim nächsten Besuch wiederhergestellt.
gridstack.addWidget=Widget hinzufügen
gridstack.removeWidget=Letztes entfernen
gridstack.reset=Layout zurücksetzen
@@ -32,6 +32,7 @@ gridstack.status=Layout geändert – {0} Widgets
gridstack.statusInitial=Layout unverändert
gridstack.widget=Widget {0}
gridstack.widgetText=Frei platzierbare Karte.
gridstack.dragHandle=Verschieben
chart.revenueSeries=Umsatz 2026
chart.pointClick=Serie {0}, Punkt {1}
@@ -24,7 +24,7 @@ card.registration=Registration
card.employees=Employees
card.gridstackHint=How it works
gridstack.hint=Drag cards by their header to move them, resize them from the bottom right corner. The layout is stored in your browser and restored on your next visit.
gridstack.hint=Move cards with the grip in their top right corner, resize them from the bottom right corner. The layout is stored in your browser and restored on your next visit.
gridstack.addWidget=Add widget
gridstack.removeWidget=Remove last
gridstack.reset=Reset layout
@@ -32,6 +32,7 @@ gridstack.status=Layout changed – {0} widgets
gridstack.statusInitial=Layout unchanged
gridstack.widget=Widget {0}
gridstack.widgetText=Freely placeable card.
gridstack.dragHandle=Move
chart.revenueSeries=Revenue 2026
chart.pointClick=Series {0}, point {1}
@@ -24,7 +24,7 @@ card.registration=Registro
card.employees=Empleados
card.gridstackHint=Cómo funciona
gridstack.hint=Arrastra las tarjetas por su título para moverlas y cambia su tamaño desde la esquina inferior derecha. El diseño se guarda en el navegador y se restaura en la próxima visita.
gridstack.hint=Mueve las tarjetas con el asa de la esquina superior derecha y cambia su tamaño desde la esquina inferior derecha. El diseño se guarda en el navegador y se restaura en la próxima visita.
gridstack.addWidget=Añadir widget
gridstack.removeWidget=Quitar el último
gridstack.reset=Restablecer diseño
@@ -32,6 +32,7 @@ gridstack.status=Diseño modificado – {0} widgets
gridstack.statusInitial=Diseño sin cambios
gridstack.widget=Widget {0}
gridstack.widgetText=Tarjeta de colocación libre.
gridstack.dragHandle=Mover
chart.revenueSeries=Ingresos 2026
chart.pointClick=Serie {0}, punto {1}