Collection book list: allow to directly input a position
This commit is contained in:
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user