diff --git a/front/src/CollectionForm.vue b/front/src/CollectionForm.vue index 9073195..53607ec 100644 --- a/front/src/CollectionForm.vue +++ b/front/src/CollectionForm.vue @@ -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" diff --git a/front/src/CollectionFormElement.vue b/front/src/CollectionFormElement.vue index 86c0aa8..3d594af 100644 --- a/front/src/CollectionFormElement.vue +++ b/front/src/CollectionFormElement.vue @@ -1,4 +1,5 @@