Skip to content

Fix sortable for floating items#916

Closed
zhizhangchen wants to merge 5 commits intojquery:masterfrom
zhizhangchen:fix-sortable-for-floating-items
Closed

Fix sortable for floating items#916
zhizhangchen wants to merge 5 commits intojquery:masterfrom
zhizhangchen:fix-sortable-for-floating-items

Conversation

@zhizhangchen
Copy link
Contributor

… floating. Fixes #8792 - Issue with floated items in connected lists.
…ing / sorting with jQuery UI 1.9.1 and above

currentItem might be floating which demands horizontal display
hence distance should be calculated based on that. This is useful
especially when the target container is initially empty, which
makes its floating property false even after some floating items
are dragged into it.
…. Fixes comment 5 of #9041: the over event fires on every pixel movement
@mikesherov
Copy link
Member

Hi @zhizhangchen, thanks for contributing! These changes look good. The only thing I would say here is that we need to add tests to the test suite to prevent future regressions. These few lines of code have went back and forth a few times in the past. Are you comfortable doing so? The jsfiddles you provided should serve as a good basis.

Also, have you signed our CLA: http://contribute.jquery.org/CLA/ ? Please do so if you haven't.

@zhizhangchen
Copy link
Contributor Author

OK, I'll try to write some tests. For the CLA, I checked with our legal 3 months ago and got a reply that he's working with Joel Kinney who was preparing an institutional agreement for companies. But after that, I haven't got any update. I'll check again.

@mikesherov
Copy link
Member

Thanks a lot! Really solid work you've done here.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this conditional come before the change triggers?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In fact, this gaurd should move above line 873, right below the other gaurd clause.

@mikesherov
Copy link
Member

landed in 89473f6 and 07ce771

@mikesherov mikesherov closed this Mar 8, 2013
@mikesherov
Copy link
Member

I wrote the tests for you :-)

@zhizhangchen
Copy link
Contributor Author

Sory I'm terribly busy these days. I'll learn the tests after I make myself through this period. Thank you very much for all the coments and the tests!

@zhizhangchen
Copy link
Contributor Author

Sorry I'm terribly busy these days. I'll learn the tests after I make myself through this period. Thank you very much for all the comments and the tests!

@mikesherov
Copy link
Member

No problem! Thank you for the fixes here!

@zhizhangchen
Copy link
Contributor Author

I read the tests. It's quite interesting. I think next time I can try to write some tests along with code changes... Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants