]> source.dussan.org Git - jquery-ui.git/commitdiff
draggable: fixed issue when scroll was set to true, and therefore droppables inside...
authorPaul Bakaus <paul.bakaus@googlemail.com>
Tue, 29 Jul 2008 00:54:29 +0000 (00:54 +0000)
committerPaul Bakaus <paul.bakaus@googlemail.com>
Tue, 29 Jul 2008 00:54:29 +0000 (00:54 +0000)
ui/ui.draggable.js

index 839232e1c173e728e7fa29c89f89e71f3ebed815..7dd6dc2b894a8334738f1b80b4560a220b55ab04 100644 (file)
@@ -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);
+               
        }
 });