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

Expose drag event #52

Merged
merged 2 commits into from
Aug 10, 2016
Merged

Expose drag event #52

merged 2 commits into from
Aug 10, 2016

Conversation

colinmathews
Copy link
Contributor

This simply sends an action while the user is dragging an object around the page.

I needed to do this for a project in order to get XY coordinates of the dragged object so I could implement custom re-ordering. In draggable-object-target there's a handleDragOver hook, but it doesn't fire when the dragging object goes over a child element in the target region.

@dgavey
Copy link
Collaborator

dgavey commented Jul 27, 2016

Ok. I'll have to write a test for it first, or you could submit that as well. Also what kind of custom re-ordering did you need?

@colinmathews
Copy link
Contributor Author

Sorry about that, I should have included a test. I just updated the PR with one.

I needed to drag objects to different targets on the page, and I wanted the underlying element to scoot aside to make room for the drop. I used the page coordinates of the drag event to figure out which element needed to get transformed.

Cheers!

@colinmathews
Copy link
Contributor Author

Hmm...seems like the tests break on ember-beta. If you happen to have a few moments to give it a glance I'd appreciate it!

@dgavey
Copy link
Collaborator

dgavey commented Jul 27, 2016

I'll give it a glance, thanks for the PR.

@dgavey
Copy link
Collaborator

dgavey commented Aug 10, 2016

Looks like the beta has a bug is causing triggerEvent to fail in tests. I will pull this in shortly.

@dgavey dgavey merged commit c9607c9 into mharris717:master Aug 10, 2016
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