-
Notifications
You must be signed in to change notification settings - Fork 441
Allow ui-sortable to work on deep items #524
base: master
Are you sure you want to change the base?
Conversation
The sortable container might not be the item's direct parent; this happens eg. in floating setups when the ng-repeated DOM node is a directive that only includes the floating node as a child, so the resulting tree with directives and CSS resolved looks like <div ng-model="items" ui-sortable="{items:'.tilefloater'}"> <tile ng-repeat="i in items> <tile-implementation class="tilefloater" sytle="float:left" ... /> </tile> </div> I'm unsure on why the .find(opts['ui-model-items']) -> .find(opts['items']) is necessary exactly (or why it doesn't say the latter originally), but it is required in the same situation; were I to (just on a guess) set {ui-model-items:'.tilefloater', items:'.tilefloater'}, there'd be leftover placeholders, and without the change, .find() doesn't catch the actually moved item.
Thanks for your PR! |
Any feedback on this? |
there will be as soon as i'm back at my workstation at the start of the week.
|
ad handle: I do use handle already, but that seems unrelated to me. |
Can you add the a set of curly in your |
Updated with braces; commits not smushed for better review. I don't know how to interpret the current test failure. ad "why not same parent": The items are not under the same parent because the angular directives that provide the (conditionally floating) items leave their own tags inbetween. |
I'm afraid that this might break things added on v0.17 that added support for transcluded directives. |
I get the same error after I pulled in the whole test suite. Is there any way to run the test suite in a more direct way than encapsulated in karma, to drill down on what makes things go wrong? |
The sortable container might not be the item's direct parent; this
happens eg. in floating setups when the ng-repeated DOM node is a
directive that only includes the floating node as a child, so the
resulting tree with directives and CSS resolved looks like
I'm unsure on why the .find(opts['ui-model-items']) ->
.find(opts['items']) is necessary exactly (or why it doesn't say the
latter originally), but it is required in the same situation; were I to
(just on a guess) set {ui-model-items:'.tilefloater',
items:'.tilefloater'}, there'd be leftover placeholders, and without the
change, .find() doesn't catch the actually moved item.