mirror of
https://github.com/MadeBaruna/paimon-moe.git
synced 2025-03-13 11:18:28 +01:00
parent
713a6d6952
commit
3aa33e0428
1 changed files with 6 additions and 2 deletions
|
@ -165,7 +165,7 @@
|
|||
isHovered = false;
|
||||
isDragging = true;
|
||||
e.dataTransfer.effectAllowed = 'move';
|
||||
e.dataTransfer.setData('text/plain', index);
|
||||
e.dataTransfer.setData('cardindex', index);
|
||||
}
|
||||
|
||||
function handleDragEnd() {
|
||||
|
@ -186,8 +186,12 @@
|
|||
|
||||
function handleDrop(e) {
|
||||
e.stopPropagation();
|
||||
|
||||
isDragHovered = false;
|
||||
const sourceIndex = Number(e.dataTransfer.getData('text/plain'));
|
||||
const sourceData = e.dataTransfer.getData('cardindex');
|
||||
if (sourceData === '') return;
|
||||
|
||||
const sourceIndex = Number(sourceData);
|
||||
dispatch('swapOrder', { from: index, to: sourceIndex });
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue