diff options
author | Paul Bakaus <paul.bakaus@googlemail.com> | 2009-01-29 15:22:43 +0000 |
---|---|---|
committer | Paul Bakaus <paul.bakaus@googlemail.com> | 2009-01-29 15:22:43 +0000 |
commit | b3ab79b859aaae81322d91edc01632068f2d56f1 (patch) | |
tree | b575be2bcd6b48424f2afb637673ebc54a10cff1 /ui/ui.draggable.js | |
parent | bcee037715691a8ae3d925777686132c73a819af (diff) | |
download | jquery-ui-b3ab79b859aaae81322d91edc01632068f2d56f1.tar.gz jquery-ui-b3ab79b859aaae81322d91edc01632068f2d56f1.zip |
draggable: containment option now respects the padding (fixes #3957)
Diffstat (limited to 'ui/ui.draggable.js')
-rw-r--r-- | ui/ui.draggable.js | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/ui/ui.draggable.js b/ui/ui.draggable.js index 95d5ea0bd..199de6152 100644 --- a/ui/ui.draggable.js +++ b/ui/ui.draggable.js @@ -272,10 +272,10 @@ $.widget("ui.draggable", $.extend({}, $.ui.mouse, { var over = ($(ce).css("overflow") != 'hidden'); this.containment = [ - co.left + (parseInt($(ce).css("borderLeftWidth"),10) || 0) - this.margins.left, - co.top + (parseInt($(ce).css("borderTopWidth"),10) || 0) - this.margins.top, - co.left+(over ? Math.max(ce.scrollWidth,ce.offsetWidth) : ce.offsetWidth) - (parseInt($(ce).css("borderLeftWidth"),10) || 0) - this.helperProportions.width - this.margins.left, - co.top+(over ? Math.max(ce.scrollHeight,ce.offsetHeight) : ce.offsetHeight) - (parseInt($(ce).css("borderTopWidth"),10) || 0) - this.helperProportions.height - this.margins.top + co.left + (parseInt($(ce).css("borderLeftWidth"),10) || 0) + (parseInt($(ce).css("paddingLeft"),10) || 0) - this.margins.left, + co.top + (parseInt($(ce).css("borderTopWidth"),10) || 0) + (parseInt($(ce).css("paddingTop"),10) || 0) - this.margins.top, + co.left+(over ? Math.max(ce.scrollWidth,ce.offsetWidth) : ce.offsetWidth) - (parseInt($(ce).css("borderLeftWidth"),10) || 0) - (parseInt($(ce).css("paddingRight"),10) || 0) - this.helperProportions.width - this.margins.left, + co.top+(over ? Math.max(ce.scrollHeight,ce.offsetHeight) : ce.offsetHeight) - (parseInt($(ce).css("borderTopWidth"),10) || 0) - (parseInt($(ce).css("paddingBottom"),10) || 0) - this.helperProportions.height - this.margins.top ]; } else if(o.containment.constructor == Array) { this.containment = o.containment; |