aboutsummaryrefslogtreecommitdiffstats
path: root/ui/jquery.ui.droppable.js
diff options
context:
space:
mode:
authorkborchers <k_borchers@yahoo.com>2011-05-27 12:01:42 -0500
committerScott González <scott.gonzalez@gmail.com>2011-05-27 15:36:37 -0400
commitce2fbb9429dd5fcaf80b1f3eef3d922b7ca06ec8 (patch)
tree7e0cca73256a1981fa6807af2f125967ff1f16ad /ui/jquery.ui.droppable.js
parentb04c6ece34a57840cce22e8680e9bb7a766994df (diff)
downloadjquery-ui-ce2fbb9429dd5fcaf80b1f3eef3d922b7ca06ec8.tar.gz
jquery-ui-ce2fbb9429dd5fcaf80b1f3eef3d922b7ca06ec8.zip
Droppable: Added dragStart and dragStop to ddmanager and call them from draggable to recalculate droppable positions after a drag causes a scroll. Fixes #5003 - Scroll on Droppable Demo Breaks Demo
(cherry picked from commit 67bd872fe1f8c4763d646f4eca852777e6f7a126)
Diffstat (limited to 'ui/jquery.ui.droppable.js')
-rw-r--r--ui/jquery.ui.droppable.js11
1 files changed, 11 insertions, 0 deletions
diff --git a/ui/jquery.ui.droppable.js b/ui/jquery.ui.droppable.js
index b8a93cd46..58a1c4bc1 100644
--- a/ui/jquery.ui.droppable.js
+++ b/ui/jquery.ui.droppable.js
@@ -238,6 +238,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 +285,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 );
}
};