mirror of
https://github.com/koel/koel
synced 2024-11-28 15:00:42 +00:00
Set correct MIME when dragging (fixes #410)
This commit is contained in:
parent
48dc6e62fd
commit
aaaa3e1a4e
3 changed files with 7 additions and 8 deletions
|
@ -91,7 +91,7 @@ export default {
|
|||
*/
|
||||
dragStart(e) {
|
||||
const songIds = map(this.album.songs, '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.
|
||||
|
|
|
@ -82,7 +82,7 @@ export default {
|
|||
*/
|
||||
dragStart(e) {
|
||||
const songIds = map(this.artist.songs, '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.
|
||||
|
|
|
@ -378,23 +378,22 @@ export default {
|
|||
*/
|
||||
handleDrop(songId, e) {
|
||||
if (this.type !== 'queue') {
|
||||
return;
|
||||
return this.removeDroppableState(e) && false;
|
||||
}
|
||||
|
||||
if (!e.dataTransfer.getData('text/plain')) {
|
||||
return false;
|
||||
if (!e.dataTransfer.getData('application/x-koel.text+plain')) {
|
||||
return this.removeDroppableState(e) && false;
|
||||
}
|
||||
|
||||
const songs = this.selectedSongs;
|
||||
|
||||
if (!songs.length) {
|
||||
return false;
|
||||
return this.removeDroppableState(e) && false;
|
||||
}
|
||||
|
||||
queueStore.move(songs, songStore.byId(songId));
|
||||
this.removeDroppableState(e);
|
||||
|
||||
return false;
|
||||
return this.removeDroppableState(e) && false;
|
||||
},
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue