문제

I'm trying to drag and drop playlists from the side-bar onto my application window. I got it working to accept drops on my app's name in the app list, but that's not what I need right now.

Is there a way to enable my view to accept playlists dragged on it?

models.application.addEventListener("dropped", function() {
  console.log(models.application.dropped)
})

And in my manifest.json I have

"AcceptedViewDropTypes": [
    "playlist"
],

"AcceptedLinkTypes": [
    "playlist"
],

This setup triggers the console log only if I drop on my app's name.

도움이 되었습니까?

해결책

There is an example of drag & drop for a Playlist in the Spotify Apps Tutorial, called Dragging and dropping content into an app.

The way it works is like regular drag & drop, listening to events such as dragstart or drop.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top