Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When drage, Swap Elements instead of moving them #891

Closed
wants to merge 1 commit into from

Conversation

Horray
Copy link

@Horray Horray commented Jun 24, 2016

This fixes problem: #869
I also think it's safer doing it like this. Let me know what you think.

} else {
target.parentNode.insertBefore(dragEl, after ? nextSibling : target);
}
swapElements(dragEl, target);
Copy link
Collaborator

Choose a reason for hiding this comment

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

@Horray
Copy link
Author

Horray commented Jun 24, 2016

@RubaXa When does that code happen?

@RubaXa RubaXa closed this Jul 5, 2016
gazugafan added a commit to gazugafan/Sortable that referenced this pull request Jan 28, 2018
This is a rough implementation of a swapping feature. Setting the new "swap" option to true will cause a dragged item to be swapped with the item you drop it on (instead of inserted next to it). The item being hovered over (and potentially swapped with) will be highlighted by adding the class specified in the new "swapHighlightClass" option (defaults to "sortable-swap-highlight"). When swapping is enabled, the "end" event's "to" property will be set to the item being dropped on and swapped with.

It's a bit hackish, but it works as a solution to issues SortableJS#1211, SortableJS#1082, SortableJS#1072, SortableJS#891, SortableJS#869, and SortableJS#469. Maybe it can at least serve as a starting off point to adding this feature to master eventually? Thanks!
@gazugafan gazugafan mentioned this pull request Jan 28, 2018
@gazugafan gazugafan mentioned this pull request Jan 17, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants