-
Notifications
You must be signed in to change notification settings - Fork 18
Conversation
this.requestData = options.request; | ||
this.rootNode = options.root_node || '/'; | ||
this.dndOptions = jQuery.extend({ | ||
enabled: false, | ||
isNodeDraggable: alwaysTrueFunction, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this option specifies a function that can determine if a node can be dragged (e.g. based on the FQCN).
great! impressive how little code is needed for this! this needs a rebase, i guess the other PRs i merged this morning are in conflict with this one. is there a plan when puli will implement move? is there an issue we could link to? |
puli/issues#42 It'll be implemented before 1.0 stable is released. |
Rebased, this can be finished once symfony-cmf/resource-rest-bundle#31 is merged. |
Would this require "reorder" in addition to "move"? |
This PR is now updated to actually request moves to the backend. The good news is that it's working locally. The less-good news: I had to use lots of dev branches of other bundles to get things working (doctrine, sonata, symfony CMF). So there still is work to do here @dantleech reorder isn't required, but would be nice :) (especially because every move node now ends up at the end of the tree, it would be nice if nodes could be put a specific place). |
we can start on that when we merge the existing move / remove PR. |
Moving to a specific Position would mean to have a position property on the node to order the siblings. I think we do have that but have no access through the phpcr-odm. Exactly @dbu ? I had Same question some years ago especially for menue nodes. |
I think we just need the name of the target node and if it should be reordered before or after it, I don't think there is any need for adding a property. |
I understood moving through siblings. That would mean they all have same parent(i do so g). That would be no move it would change the sorting Order of siblings. And that is extremely important on menue nodes and unimportant on all others. (Except we will have Collection Documents with a specific meaning in their order i.e. ranked profiles in a game) |
yep, phpcr (and thus phpcr-odm) know ordering operations which are not
the same as moving. moving appends to the end. reordering you can put a
document before or after a specific child, if i remember correctly.
https://github.com/doctrine/phpcr-odm/blob/master/lib/Doctrine/ODM/PHPCR/DocumentManager.php#L598
|
That reordering fits perfectly in the way Fancytree is handling dropping reorderings (move before/after a node). Would be great if it can be included in the rest bundle. (but let's focus on just moving first) |
👍 but should notice all ideas in new issues (sorry for that, i am a parttime scrum master atm)
|
👍 lets get moving merged first. can you please update the PR description with links to the other PRs that need to be merged for this to work? resp. issues if there are problems without a PR. |
Can you rebase please? |
Updated this PR, it now depends on symfony-cmf/resource-rest-bundle#46 to work. |
i merged the resource-rest-bundle pr. can you check if all is fine, and remove the [WIP] in the title if it is? |
I've tested this PR and the just-merged PR on the CMF sandbox, so I'm sure it's fine. |
yeah! |
Puli isn't able to do move actions yet, so the back-end is not implemented. However, this should give a first impression of what drag 'n drop is going to look like in the tree.
Fixes #93
Depends On