I'm writing directive for multiple drag and drop using jQueryUI. Holding CTRL and selecting elements you can do multiple sorting. It works ok, except when element doesn't change position (I drag it, and then return it on same place). In that case, element is gone, although model is fine, and it displays all the elements correctly.
Here's the fiddle, for what I've done. http://jsfiddle.net/ndamnjanovic/swt48/3/
That's why I tried to manually insert HTML node, in case element is returned on same position.
But in this case, after I insert element with ui.item.after(elements).detach(), elements lose associated actions (clicking on it doesn't trigger alertCity anymore).
Here's the fiddle with other approach.
http://jsfiddle.net/ndamnjanovic/EkVTW/11/
Any ideas what's the problem here?