From: Paul Bakaus Date: Thu, 29 Jan 2009 15:25:02 +0000 (+0000) Subject: sortable: containment option now respects the padding (fixes #3958) X-Git-Tag: 1.6rc6~37 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=04c063e5b7abe7fb1d9be52c01cdd409483340dd;p=jquery-ui.git sortable: containment option now respects the padding (fixes #3958) --- diff --git a/ui/ui.sortable.js b/ui/ui.sortable.js index 0ff3107b4..614670c18 100644 --- a/ui/ui.sortable.js +++ b/ui/ui.sortable.js @@ -778,10 +778,10 @@ $.widget("ui.sortable", $.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 ]; }