ember-drag-drop
ember-drag-drop copied to clipboard
Multiple and nested sortable-objects
Hi guys,
I've been working on extending the addon to support some features that I need to use in a project I'm working on. Specifically, I need to have multiple sortable-objects components on one page and allow dragging of items between those lists.
I also need to allow nested sortable-objects on one page.
I've got a first-pass of this working on a local branch and was hoping to push to the repo but I'm getting a 'Permission denied' when attempting that. Any chance you could add me as a collaborator so that I may create a PR and get your feedback on my changes with the hope of having them merged into master at some point?
Thanks, Graeme
Hey, so glad to hear you got some additions ready to be merged. I appreciate any additions.
You don't need collaborator access to submit a PR. Once you fork the project to your own repo, you can apply the changes you want merged there. Then in github you can submit the PR from there.
I will take a look at them and make sure the tests pass. Speaking of tests, I would love to have some tests made for the additions you're adding. If you find time to do that, that would be appreciated.
Here is an article about how to make a PR if my instructions aren't clear enough.
https://yangsu.github.io/pull-request-tutorial/
Thanks for the clarification - I've now created the PR on a fork.
https://github.com/mharris717/ember-drag-drop/pull/34
I had a failing test locally but I believe that was failing when I originally cloned the repo. I will look into it.
I would like to add new tests - I'll do that next. Would be great to get any feedback, ideas for improvement or ways to simplify if anything jumps out at you. It's a first-pass but should hopefully be useful to others, or at least on its way to that.
Ah, I had a failing test on master but only when running them in the browser. My PR does have a legit failing test which I will need to fix
I did some styling work for your addon examples. Also did a bit of a refactor on the code generally. I also fixed the issues that caused the above tests to fail intermittently. Once @Bushjumper has reviewed it and merged it into his branch it will be available on the open pr: #34
I would like to suggest a look at integrating a gesture library like ember-gestures into this addon to handle the events and provide better mobile support. Currently its pretty tightly coupled with events like mousedown which isnt ideal for mobile environments.
As I am currently working on a project containing multiple nested sortable objects, I was wondering if there is any chance to include this feature in the near future? All the best and thanks a lot for the great work!
We are on the way to it. Currently on the master branch but not released is the ability to drag something from one container to another. Nesting will be the next step.
On Aug 17, 2016 6:18 AM, "OlmoDalco" [email protected] wrote:
As I am currently working on a project containing multiple nested sortable objects, I was wondering if there is any chance to include this feature in the near future? All the best and thanks a lot for the great work!
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/mharris717/ember-drag-drop/issues/33#issuecomment-240394309, or mute the thread https://github.com/notifications/unsubscribe-auth/AAuHhZ4erjcKL4IDIUAvjwsi943tjq4Kks5qgvwtgaJpZM4H5hyA .
In my current use case, I've got a parent Ember object that contains N sortable objects, which in turn each contain N draggable objects. When a draggable object is moved, I'm walking the entire parent Ember object and updating the contents and positions of each child Ember object on my backend at the end of each drop. It works for now, but it won't scale well. It would be better if I could isolate the updates on the backend to the specific objects (sortable and draggable) that were affected.
I favor the approach of allowing the user to assign an arbitrary, unique payload (for example, the id of the parent Ember object) to each sortable object, and reporting the fromSortable, toSortable, and draggableDropped to the drop handler. Then the drop event handler can manage the updates by looking up the affected Ember objects.
I began to throw something together along these lines for my own purposes, but I wasn't satisfied with the results. Maybe you already have plans in this direction, or a better API in mind?
What is the status on this? Does this include having draggable objects that can be nested? I am currently experiencing issues with having a draggable-object inside another draggable-object. I cannot drag the inner object, it immediately becomes draggable and then stays opacity .5 and loses the context of the mouse dragging the object. @dgavey
We have basic support for multiple sortable containers and the ability to move items between them. We still don't have the ability to support nested folders.