Jump to content

Set media items as drop targets?


Recommended Posts

Protected
Posted

Hi there. I'm trying to set items in the folder view (datagrid) as drop targets such that items can be dropped into other items, to go with a custom Rest service endpoint from a plugin I made. No matter what I do, however, I can't get onDrop from emby-itemscontainer to fire when I drop items here. I've tried setting dropTarget to 1 in the view options as well as adding html classes manually (classes do pop up in the items if I set dropTarget to 1). Maybe I'm not doing it in the right place, though. What exactly do I need to do to turn rows from the table into drop targets?

Posted

Hi, those do not get setup as drop targets. Only playlists and collections. Things that you can add to in other words.

Protected
Posted

Sure, but I'm willing to tweak that...

I see the hardcoded references to Playlist and BoxSet in the emby-itemcontainer javascript. Is onDrop not firing because the drag is cancelled?

Posted

Off the top of my head I don't recall. It could be that the event listeners are not added when they aren't needed.

Protected
Posted

Yeah, that's definitely the source of my confusion. I see the event listeners *nowhere* on the dom but they work regardless. Looking at the code it seems like the event listener (for dropping) should always be added alongside the others. I'll explore the aborted drag possibility tomorrow I guess. Thanks anyway.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...