aboutsummaryrefslogtreecommitdiffstats
path: root/ui/jquery.ui.draggable.js
diff options
context:
space:
mode:
authorScott González <scott.gonzalez@gmail.com>2011-05-13 12:35:18 -0700
committerScott González <scott.gonzalez@gmail.com>2011-05-13 12:35:18 -0700
commit2adfc03efee811f455a55e26eab9fff2a70a8093 (patch)
treea183c3dcca31ffc995b4bc7496f3f3ad31583424 /ui/jquery.ui.draggable.js
parenta69a1788bc5cd67c6e627e519e20897a0c238945 (diff)
parent6e6d0b749c4724955a88a0a53ae1378391991064 (diff)
downloadjquery-ui-2adfc03efee811f455a55e26eab9fff2a70a8093.tar.gz
jquery-ui-2adfc03efee811f455a55e26eab9fff2a70a8093.zip
Merge pull request #266 from kborchers/bug_4838
Draggable: Changed logic to only subtract left and top offsets of containment if left and top are not already 0. Fixed #4838 - containment: 'document' is incorrect for top and left in draggable
Diffstat (limited to 'ui/jquery.ui.draggable.js')
-rw-r--r--ui/jquery.ui.draggable.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/ui/jquery.ui.draggable.js b/ui/jquery.ui.draggable.js
index 10d7e8a13..c16833eb0 100644
--- a/ui/jquery.ui.draggable.js
+++ b/ui/jquery.ui.draggable.js
@@ -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
];