aboutsummaryrefslogtreecommitdiffstats
path: root/ui/ui.resizable.js
diff options
context:
space:
mode:
authorEduardo Lundgren <eduardolundgren@gmail.com>2009-02-15 14:51:59 +0000
committerEduardo Lundgren <eduardolundgren@gmail.com>2009-02-15 14:51:59 +0000
commiteb5858f69f0d8a73fc30b37958a6b63909b37b79 (patch)
tree375c7d08c683a369b91b5754eb1308d38dd96db4 /ui/ui.resizable.js
parent26f1b0330f26a64e29a3f9cdec5f1d879907bfdd (diff)
downloadjquery-ui-eb5858f69f0d8a73fc30b37958a6b63909b37b79.tar.gz
jquery-ui-eb5858f69f0d8a73fc30b37958a6b63909b37b79.zip
Resizable: Fixed #4147 - Little jump when a resizable is about to reach the coordinate 0 (in x- or y-axis)
Diffstat (limited to 'ui/ui.resizable.js')
-rw-r--r--ui/ui.resizable.js16
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);