diff options
author | Paul Bakaus <paul.bakaus@googlemail.com> | 2008-07-29 00:54:29 +0000 |
---|---|---|
committer | Paul Bakaus <paul.bakaus@googlemail.com> | 2008-07-29 00:54:29 +0000 |
commit | 1bf23b38fd85c43ee180564e70348e35a8787a54 (patch) | |
tree | 7f803185f89a06e8c8092d79fec0ba67c58b66e0 /ui/ui.draggable.js | |
parent | 67b53a582e2b4e8378c521f3462c0d057c7c1a2b (diff) | |
download | jquery-ui-1bf23b38fd85c43ee180564e70348e35a8787a54.tar.gz jquery-ui-1bf23b38fd85c43ee180564e70348e35a8787a54.zip |
draggable: fixed issue when scroll was set to true, and therefore droppables inside changed their position as well
Diffstat (limited to 'ui/ui.draggable.js')
-rw-r--r-- | ui/ui.draggable.js | 20 |
1 files 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); + } }); |