mirror of
https://github.com/koel/koel
synced 2025-02-17 22:08:28 +00:00
Fix drag and drop
This commit is contained in:
parent
8d76859df7
commit
a87b456f9b
3 changed files with 5 additions and 7 deletions
|
@ -107,11 +107,11 @@ export default {
|
|||
handleDrop(e) {
|
||||
this.removeDroppableState(e);
|
||||
|
||||
if (!e.dataTransfer.getData('text/plain')) {
|
||||
if (!e.dataTransfer.getData('application/x-koel.text+plain')) {
|
||||
return false;
|
||||
}
|
||||
|
||||
const songs = songStore.byIds(e.dataTransfer.getData('text/plain').split(','));
|
||||
const songs = songStore.byIds(e.dataTransfer.getData('application/x-koel.text+plain').split(','));
|
||||
|
||||
if (!songs.length) {
|
||||
return false;
|
||||
|
|
|
@ -118,11 +118,11 @@ export default {
|
|||
handleDrop(e) {
|
||||
this.removeDroppableState(e);
|
||||
|
||||
if (!e.dataTransfer.getData('text/plain')) {
|
||||
if (!e.dataTransfer.getData('application/x-koel.text+plain')) {
|
||||
return false;
|
||||
}
|
||||
|
||||
const songs = songStore.byIds(e.dataTransfer.getData('text/plain').split(','));
|
||||
const songs = songStore.byIds(e.dataTransfer.getData('application/x-koel.text+plain').split(','));
|
||||
|
||||
if (!songs.length) {
|
||||
return false;
|
||||
|
|
|
@ -343,10 +343,8 @@ export default {
|
|||
}
|
||||
|
||||
this.$nextTick(() => {
|
||||
// We can opt for something like application/x-koel.text+plain here to sound fancy,
|
||||
// but forget it.
|
||||
const songIds = map(this.selectedSongs, 'id');
|
||||
e.dataTransfer.setData('text/plain', songIds);
|
||||
e.dataTransfer.setData('application/x-koel.text+plain', songIds);
|
||||
e.dataTransfer.effectAllowed = 'move';
|
||||
|
||||
// Set a fancy drop image using our ghost element.
|
||||
|
|
Loading…
Add table
Reference in a new issue