Collection book list: allow to directly input a position

This commit is contained in:
2026-04-12 15:46:23 +02:00
parent 255f24904c
commit 55a4a98b4d
4 changed files with 67 additions and 8 deletions

View File

@@ -58,7 +58,11 @@ function onDrop(id, position) {
//nothing to do
return
}
postCollectionChangePosition(props.id, itemIdBeingGrabbed.value, position).then((res) => {
changePosition(itemIdBeingGrabbed.value, position)
}
function changePosition(id, position) {
postCollectionChangePosition(props.id, id, position).then((res) => {
if (res.ok) {
getCollection(data, error, props.id, limit, offset.value)
} else {
@@ -87,6 +91,7 @@ function onDragend() {
@dragend="onDragend"
@dragover="onDragover"
@dragenter="itemIdBeingOvered = item.id"
@positionchange="(pos) => changePosition(item.id, pos)"
v-for="item in data.items"
:key="item.id"
:is-dragover="itemIdBeingOvered === item.id"