r2083 - trunk/ui

r2083 - trunk/ui


Author: eduardolundgren
Date: Sun Feb 15 06:51:59 2009
New Revision: 2083
Modified:
trunk/ui/ui.resizable.js
Log:
Resizable: Fixed #4147 - Little jump when a resizable is about to reach the
coordinate 0 (in x- or y-axis)
Modified: trunk/ui/ui.resizable.js
==============================================================================
--- trunk/ui/ui.resizable.js    (original)
+++ trunk/ui/ui.resizable.js    Sun Feb 15 06:51:59 2009
@@ -325,10 +325,10 @@
    _updateCache: function(data) {
        var o = this.options;
        this.offset = this.helper.offset();
-        if (data.left) this.position.left = data.left;
-        if (data.top) this.position.top = data.top;
-        if (data.height) this.size.height = data.height;
-        if (data.width) this.size.width = data.width;
+        if (isNumber(data.left)) this.position.left = data.left;
+        if (isNumber(data.top)) this.position.top = data.top;
+        if (isNumber(data.height)) this.size.height = data.height;
+        if (isNumber(data.width)) this.size.width = data.width;
    },
    _updateRatio: function(data, event) {
@@ -352,10 +352,6 @@
    _respectSize: function(data, event) {
-        var isNumber = function(value) {
-            return !isNaN(parseInt(value, 10));
-        };
-
        var el = this.helper, o = this.options, pRatio = this._aspectRatio ||
event.shiftKey, a = this.axis,
                ismaxw = isNumber(data.width) && o.maxWidth && (o.maxWidth <
data.width), ismaxh = isNumber(data.height) && o.maxHeight && (o.maxHeight
< data.height),
                    isminw = isNumber(data.width) && o.minWidth && (o.minWidth >
data.width), isminh = isNumber(data.height) && o.minHeight && (o.minHeight