Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Draggable: Changed logic to only subtract left and top offsets of con…

…tainment if left and top are not already 0. Fixed #4838 - containment: 'document' is incorrect for top and left in draggable
  • Loading branch information...
commit 6e6d0b749c4724955a88a0a53ae1378391991064 1 parent 1845015
@kborchers kborchers authored
Showing with 2 additions and 2 deletions.
  1. +2 −2 ui/jquery.ui.draggable.js
View
4 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
];
Please sign in to comment.
Something went wrong with that request. Please try again.