You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to disable the sort functionality. I don't want the list to be automatically sorted nor for the elements to be slid up.
Instead of the elements sliding up as I drag the element I want to reposition, I want it to be swapped with whatever element is below, or the current index/location of the dragged element.
The onEnd event, only passes the same index for both the oldIndex and newIndex
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!
JS Bin: http://jsbin.com/zukifob/edit?js,console,output
I am trying to disable the sort functionality. I don't want the list to be automatically sorted nor for the elements to be slid up.
Instead of the elements sliding up as I drag the element I want to reposition, I want it to be swapped with whatever element is below, or the current index/location of the dragged element.
The
onEnd
event, only passes the same index for both theoldIndex
andnewIndex
I can see the
oldIndex
in theonStart
event. How can I see the new selected index while disabling thesort
functionality.The text was updated successfully, but these errors were encountered: