Thanks to visit codestin.com
Credit goes to github.com

Skip to content
This repository was archived by the owner on Sep 8, 2020. It is now read-only.

Fixed to work with deep descendants #492

Closed
wants to merge 5 commits into from
Closed

Fixed to work with deep descendants #492

wants to merge 5 commits into from

Conversation

yenoh2
Copy link
Contributor

@yenoh2 yenoh2 commented Nov 28, 2016

In trying to use ui-sortable with Angular Material tabs, I found that it didn't work for two reasons. First you can't have two directives with an isolated scope on the same element. Second, ui-sortable didn't support items that aren't a direct decendant. I modified the "getElementScope" function to get the applicable scope for the draggable item, if the normal code results in null. I also wrapped the md-tabs directive in a div containing the ui-sortable directive to circumvent the two directives with isolated scopes issues.

As far as I can tell, this works. Can you see any issues with my change?

See the following example:
http://codepen.io/yenoh2/pen/rWxxVJ

This seems to be related to "Using ui.sortable with angular ui.bootstrap.tabs have a weird interaction #248"

I'm modifying the code to handle situations where the ng-repeat isn't directly nested in the ui-sortable directive.
Also added a CodePen example illustrating the functioning change.
@thgreasi
Copy link
Contributor

Great! Can you resolve the linter errors that travis-ci seems to complain about? I will try to review during the weekend.

@thgreasi
Copy link
Contributor

I'm also thinking of removing the isolated scope thing. It should be safe, since we are not using the scope at all.

@thgreasi
Copy link
Contributor

I just remembered that the main issue we had was canceling on transcluded directives. Maybe this is an opportunity to finally add that feature.

@yenoh2
Copy link
Contributor Author

yenoh2 commented Nov 28, 2016 via email

@yenoh2
Copy link
Contributor Author

yenoh2 commented Nov 28, 2016 via email

@yenoh2
Copy link
Contributor Author

yenoh2 commented Nov 28, 2016 via email

@thgreasi
Copy link
Contributor

The last two years I've tried properly implementing canceling with transcluded directives but always some extra commitments appeared and I had to stash everything. Tryied both your approach and also on the same element after removing the scope from ui-sortable. We can try to get it right this time. I was thinking about an option to specify the transclusion target that hosts the sortable items.

@yenoh2
Copy link
Contributor Author

yenoh2 commented Nov 29, 2016

I made the corrections for the linter errors. How do I re-check?

@thgreasi
Copy link
Contributor

Great!
I think that the tests aren't running because your branch is conflicting with the current master (I released a fix yesterday).
How about rebasing to the current master (or opening a new PR, if that works better for you)?

@thgreasi
Copy link
Contributor

Closing this in favor of #494

@thgreasi thgreasi closed this Nov 30, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants