From 1bf23b38fd85c43ee180564e70348e35a8787a54 Mon Sep 17 00:00:00 2001 From: Paul Bakaus Date: Tue, 29 Jul 2008 00:54:29 +0000 Subject: [PATCH] draggable: fixed issue when scroll was set to true, and therefore droppables inside changed their position as well --- ui/ui.draggable.js | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/ui/ui.draggable.js b/ui/ui.draggable.js index 839232e1c..7dd6dc2b8 100644 --- a/ui/ui.draggable.js +++ b/ui/ui.draggable.js @@ -348,32 +348,36 @@ $.ui.plugin.add("draggable", "scroll", { var o = ui.options; var i = $(this).data("draggable"); + var scrolled = false; if(i.scrollTopParent[0] != document && i.scrollTopParent[0].tagName != 'HTML') { if((i.overflowYOffset.top + i.scrollTopParent[0].offsetHeight) - e.pageY < o.scrollSensitivity) - i.scrollTopParent[0].scrollTop = i.scrollTopParent[0].scrollTop + o.scrollSpeed; + i.scrollTopParent[0].scrollTop = scrolled = i.scrollTopParent[0].scrollTop + o.scrollSpeed; if(e.pageY - i.overflowYOffset.top < o.scrollSensitivity) - i.scrollTopParent[0].scrollTop = i.scrollTopParent[0].scrollTop - o.scrollSpeed; + i.scrollTopParent[0].scrollTop = scrolled = i.scrollTopParent[0].scrollTop - o.scrollSpeed; } else { if(e.pageY - $(document).scrollTop() < o.scrollSensitivity) - $(document).scrollTop($(document).scrollTop() - o.scrollSpeed); + scrolled = $(document).scrollTop($(document).scrollTop() - o.scrollSpeed); if($(window).height() - (e.pageY - $(document).scrollTop()) < o.scrollSensitivity) - $(document).scrollTop($(document).scrollTop() + o.scrollSpeed); + scrolled = $(document).scrollTop($(document).scrollTop() + o.scrollSpeed); } if(i.scrollLeftParent[0] != document && i.scrollLeftParent[0].tagName != 'HTML') { if((i.overflowXOffset.left + i.scrollLeftParent[0].offsetWidth) - e.pageX < o.scrollSensitivity) - i.scrollLeftParent[0].scrollLeft = i.scrollLeftParent[0].scrollLeft + o.scrollSpeed; + scrolled = i.scrollLeftParent[0].scrollLeft = i.scrollLeftParent[0].scrollLeft + o.scrollSpeed; if(e.pageX - i.overflowXOffset.left < o.scrollSensitivity) - i.scrollLeftParent[0].scrollLeft = i.scrollLeftParent[0].scrollLeft - o.scrollSpeed; + scrolled = i.scrollLeftParent[0].scrollLeft = i.scrollLeftParent[0].scrollLeft - o.scrollSpeed; } else { if(e.pageX - $(document).scrollLeft() < o.scrollSensitivity) - $(document).scrollLeft($(document).scrollLeft() - o.scrollSpeed); + scrolled = $(document).scrollLeft($(document).scrollLeft() - o.scrollSpeed); if($(window).width() - (e.pageX - $(document).scrollLeft()) < o.scrollSensitivity) - $(document).scrollLeft($(document).scrollLeft() + o.scrollSpeed); + scrolled = $(document).scrollLeft($(document).scrollLeft() + o.scrollSpeed); } + if(scrolled !== false) + $.ui.ddmanager.prepareOffsets(i, e); + } }); -- 2.39.5