diff options
-rw-r--r-- | ui/ui.resizable.js | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/ui/ui.resizable.js b/ui/ui.resizable.js index bea9b4de1..bfa04ede2 100644 --- a/ui/ui.resizable.js +++ b/ui/ui.resizable.js @@ -325,10 +325,10 @@ $.widget("ui.resizable", $.extend({}, $.ui.mouse, { _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 @@ $.widget("ui.resizable", $.extend({}, $.ui.mouse, { _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 > data.height); @@ -783,4 +779,8 @@ var num = function(v) { return parseInt(v, 10) || 0; }; +var isNumber = function(value) { + return !isNaN(parseInt(value, 10)); +}; + })(jQuery); |