]> source.dussan.org Git - jquery-ui.git/commitdiff
Draggable: Changed logic to only subtract left and top offsets of containment if...
authorkborchers <k_borchers@yahoo.com>
Thu, 12 May 2011 21:27:12 +0000 (16:27 -0500)
committerScott González <scott.gonzalez@gmail.com>
Fri, 13 May 2011 19:35:53 +0000 (15:35 -0400)
(cherry picked from commit 6e6d0b749c4724955a88a0a53ae1378391991064)

ui/jquery.ui.draggable.js

index 3d007869ee2eebde2f96eff9f905f501086d590a..162c982c441162eec1e917363eee9ff2e4662e1c 100644 (file)
@@ -355,8 +355,8 @@ $.widget("ui.draggable", $.ui.mouse, {
                var o = this.options;
                if(o.containment == 'parent') o.containment = this.helper[0].parentNode;
                if(o.containment == 'document' || o.containment == 'window') this.containment = [
-                       (o.containment == 'document' ? 0 : $(window).scrollLeft()) - this.offset.relative.left - this.offset.parent.left,
-                       (o.containment == 'document' ? 0 : $(window).scrollTop()) - this.offset.relative.top - this.offset.parent.top,
+                       o.containment == 'document' ? 0 : $(window).scrollLeft() - this.offset.relative.left - this.offset.parent.left,
+                       o.containment == 'document' ? 0 : $(window).scrollTop() - this.offset.relative.top - this.offset.parent.top,
                        (o.containment == 'document' ? 0 : $(window).scrollLeft()) + $(o.containment == 'document' ? document : window).width() - this.helperProportions.width - this.margins.left,
                        (o.containment == 'document' ? 0 : $(window).scrollTop()) + ($(o.containment == 'document' ? document : window).height() || document.body.parentNode.scrollHeight) - this.helperProportions.height - this.margins.top
                ];