Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add onDropText event to support text dropping #24

Closed
wants to merge 1 commit into from
Closed

add onDropText event to support text dropping #24

wants to merge 1 commit into from

Conversation

mathiasvr
Copy link

Hi, I was taking a look at the webtorrent/webtorrent-desktop#284 issue, and ended up adding a onDropText event in the drag-drop module. It is used like the other extra events:

dragDrop('#dropTarget', {
  onDrop: function (files, pos) { console.log('Dropped files', files) },
  onDropText: function (text, pos) { console.log('Dropped text', text) }
})

I don't know if this belongs here, since the module is based around file dropping, but this PR keeps the module backward compatible and only changes the modules behavior if the onDropText event is registered (adds drag class for strings etc.).

However we can probably get this to work directly in WebTorrent Desktop if you prefer.

@feross
Copy link
Owner

feross commented Aug 4, 2016

Thanks for the PR @mathiasvr, but I saw #25 first and already merged that. I ended up adding an onDropText and making many of the same changes that you made :)

@feross feross closed this Aug 4, 2016
@mathiasvr
Copy link
Author

@feross No problem, nice work. 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants