r1859 - trunk/ui

r1859 - trunk/ui


Author: paul.bakaus
Date: Thu Jan 29 07:22:43 2009
New Revision: 1859
Modified:
trunk/ui/ui.draggable.js
Log:
draggable: containment option now respects the padding (fixes #3957)
Modified: trunk/ui/ui.draggable.js
==============================================================================
--- trunk/ui/ui.draggable.js    (original)
+++ trunk/ui/ui.draggable.js    Thu Jan 29 07:22:43 2009
@@ -272,10 +272,10 @@
            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;