-
Notifications
You must be signed in to change notification settings - Fork 782
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 dropactivate and dropdeactivate events #60
Conversation
These events will be fired during dragstart/dragend on every dropzone the draggable would be accepted.
Wow, thanks for all the work. Unfortunately, I can't accept all of this implementation. I've been working on refactoring and fixing bugs in the drop-related code and a lot of your changes would no longer apply. I'd happily accept If you'd still like to help, I'll let you know when I've finished the refactor (should be very soon) and outline the points of improvement so that you can implement the new events with those. |
When I saw lines 68 onwards of the file, I thought that you had been using 8 spaes for indentation throughout the file. I see now that you just indented twice there. Reducing that by one level would be more consistent with how I've done it in other places but I don't mind leaving the indentation as it is. |
Tidy up HTML by moving CSS and JS to separate files and fix indentation levels.
Remove dropactivate/dropdeactivate logic but keep event bindings for the new events.
Thanks for your feedback! No problem, I tidied up the demo page. Furthermore I removed everything despite the event bindings for the new events (as you said they won't cause any problems). I kept my changes regarding the new events in a separate branch now. Sure, I would like to help if you finished your drop refactoring. |
* upstream/master: Fix the options test Update tests for gesture events to be less broken Remove trailing whitespace Make a small change to avoid a jshint warning Fix interact.isSet Update 'pointerWasMoved' even with no 'prepared' Fix Interactable#preventDefault Record Touchevents in addition to PointerEvents
I've merged #61 so if you merge my master branch into this, you can work on the (de)activate events with the cleaner code. Line 2376: if you want to create the events in
Identical dropzones are all adjacent in the dropzones array. When iterating through and firing events for each dropzone, you could compare the current dropzone interactable to the previous one and create a new event if they are different. Those are my tips. Feel free to do it however you think is best :). |
* remotes/upstream/master: Tidy and compact getDrop Fix a bug in the default Interactable#getRect Add and use the 'getDropEvents' function Try again to fix dynamicDrop Collect possible and actual drops separately Fix the 'dynamicDrop' setting Combine checks for selector and element dropzones Add element argument to Interactable#getRect Reorganise the process for getting drops Fix enter/leave with same draggable and dropzone Conflicts: interact.js
* upstream/master: Add snap actions array to docs Add 'interact.js' and 'drag and drop' keywords
Setup dropzones with different accept options. Highlight draggable if it can be dropped. Add a draggable that can't be dropped.
I extended the To fire the new events on all active dropzones I created a new I hope it was fine to introduce a new private method, because the logic for both events is exactly the same besides the event to be fired. Last but not least I updated the dropzones demo. |
* upstream/master: Pass pointer event to getDropEvents dropCheck argument Conflicts: interact.js
Beautiful! |
Add dropactivate and dropdeactivate events
These events will be fired during dragstart/dragend on every dropzone the draggable would be accepted and fixes #54.
I Also added an example page
demo/dropzones.html
to demonstrate a proper use case.