Jasig/uPortal — pull request #364 by mpolizzotti (2014-06-26 22:00:03+00:00)
Title: UP-4000: Gallery drag and drop not working with fluid 1.5.

- Updated gallery drag and drop to work in both universality and respondr.

Notes:
The initDragAndDrop() method call has been wrapped within a setTimeout to resolve a fluid.pager bug (i.e. UP-4000). When the onModelChange event fires the DOM contained within the pager.container element becomes stale. For some reason that is not yet known, the pager's internal DOM, within the onModelChange event, is not ready for manipulation. This is important because the initDragAndDrop() method needs to apply the jQuery UI Draggable plugin to the underlying list items contained within the pager.container. With a stale or out-of-sync DOM the list items within the gallery fail to become draggable. Wrapping this method call within a setTimeout with the duration set to 0 forces the initDragAndDrop() method to be the last JavaScript function executed, giving time for the DOM to be redrawn.

It is also important to note the 'position' style definition has been dynamically added to the 'body' tag to accommodate a FireFox/jQuery UI specific bug. We are using jQuery UI Draggable to drag portlets from the gallery to the portal's columns. Firefox has an issue placing the cursor correctly on the dragged element. Adding a 'position of relative' fixes this issue. A fix for this bug is schedule for jQuery UI 1.11. This fix has been added using JavaScript due to the fact that adding the position definition breaks the functionality in Chrome, Safari and IE.

StackOverflow
http://stackoverflow.com/questions/18008657/jquery-ui-draggable-1-10-3-issue-with-firefox-not-finding-cursor-center-when-win

JIRA:
https://issues.jasig.org/browse/UP-4000