diff options
Diffstat (limited to 'ui/jquery.ui.droppable.js')
-rw-r--r-- | ui/jquery.ui.droppable.js | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/ui/jquery.ui.droppable.js b/ui/jquery.ui.droppable.js index b8a93cd46..3942c6b8f 100644 --- a/ui/jquery.ui.droppable.js +++ b/ui/jquery.ui.droppable.js @@ -16,6 +16,7 @@ (function( $, undefined ) { $.widget("ui.droppable", { + version: "@VERSION", widgetEventPrefix: "drop", options: { accept: '*', @@ -146,10 +147,6 @@ $.widget("ui.droppable", { }); -$.extend($.ui.droppable, { - version: "@VERSION" -}); - $.ui.intersect = function(draggable, droppable, toleranceMode) { if (!droppable.offset) return false; @@ -238,6 +235,12 @@ $.ui.ddmanager = { return dropped; }, + dragStart: function( draggable, event ) { + //Listen for scrolling so that if the dragging causes scrolling the position of the droppables can be recalculated (see #5003) + draggable.element.parentsUntil( "body" ).bind( "scroll.droppable", function() { + if( !draggable.options.refreshPositions ) $.ui.ddmanager.prepareOffsets( draggable, event ); + }); + }, drag: function(draggable, event) { //If you have a highly dynamic page, you might try this option. It renders positions every time you move the mouse. @@ -279,6 +282,11 @@ $.ui.ddmanager = { } }); + }, + dragStop: function( draggable, event ) { + draggable.element.parentsUntil( "body" ).unbind( "scroll.droppable" ); + //Call prepareOffsets one final time since IE does not fire return scroll events when overflow was caused by drag (see #5003) + if( !draggable.options.refreshPositions ) $.ui.ddmanager.prepareOffsets( draggable, event ); } }; |