Skip to content
Permalink
Browse files

Resizable: Fixed #4147 - Little jump when a resizable is about to rea…

…ch the coordinate 0 (in x- or y-axis)
  • Loading branch information...
eduardolundgren committed Feb 15, 2009
1 parent 26f1b03 commit eb5858f69f0d8a73fc30b37958a6b63909b37b79
Showing with 8 additions and 8 deletions.
  1. +8 −8 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);

0 comments on commit eb5858f

Please sign in to comment.
You can’t perform that action at this time.