Fix dragdrop2
Dragdrop was broken by addition of snapToParent in several ways, most
notably positioning of ghost/captions in scrollable parents.
Additionally, snapToParent incorrectly assumed that parent element would
not change - if given method in config, parent element should be
redetermined every time a drag is initiated.
snapToParent is really nothing more than a specialized case of the base
viewport handling. Rewrite to handle all positioning internally as an
absolute offset from the current cursor position. This means that
positioning is no longer reliant on the parent element and is instead
determined relative to the viewport itself, which makes things much
clearer in the code.
This means we no longer have to insert the ghosted element in the same
parent as the original element. This is fantastic news because it means
that formatting of the ghost drag element is now completely independent
of the original element (e.g. in imp, there were some certain elements
of the original folder element we DON'T want copied over to the ghosted
element; CSS makes it trivial to duplicate the old behavior).
Optimize dragging with caption by caching positoning data until caption
text changes.
parentElement is duplicative of snapToParent option - snapToParent now
takes either a boolean or function as an argument