diff options
author | kborchers <k_borchers@yahoo.com> | 2011-05-12 16:27:12 -0500 |
---|---|---|
committer | Scott González <scott.gonzalez@gmail.com> | 2011-05-13 15:35:53 -0400 |
commit | 18669056957c49d5b72693a1d61d47f041d6e5ff (patch) | |
tree | fd15e4c206ff90908ee4f6bd2cd40016b119172d /ui/jquery.ui.draggable.js | |
parent | 427f3d4345c6c3507fefcd9319adaf5588faaad4 (diff) | |
download | jquery-ui-18669056957c49d5b72693a1d61d47f041d6e5ff.tar.gz jquery-ui-18669056957c49d5b72693a1d61d47f041d6e5ff.zip |
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
(cherry picked from commit 6e6d0b749c4724955a88a0a53ae1378391991064)
Diffstat (limited to 'ui/jquery.ui.draggable.js')
-rw-r--r-- | ui/jquery.ui.draggable.js | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/ui/jquery.ui.draggable.js b/ui/jquery.ui.draggable.js index 3d007869e..162c982c4 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 ]; |