Skip to content

Commit

Permalink
Resizable: Removed call to $.isEmptyObject() to support jQuery < 1.4
Browse files Browse the repository at this point in the history
  • Loading branch information
eromba committed Jul 16, 2012
1 parent 9a2b896 commit e4958e1
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions ui/jquery.ui.resizable.js
Expand Up @@ -279,7 +279,8 @@ $.widget("ui.resizable", $.ui.mouse, {
var el = this.helper, o = this.options, props = {},
that = this, smp = this.originalMousePosition, a = this.axis,
prevTop = this.position.top, prevLeft = this.position.left,
prevWidth = this.size.width, prevHeight = this.size.height;
prevWidth = this.size.width, prevHeight = this.size.height,
elemResized = false;

var dx = (event.pageX-smp.left)||0, dy = (event.pageY-smp.top)||0;
var trigger = this._change[a];
Expand All @@ -302,23 +303,27 @@ $.widget("ui.resizable", $.ui.mouse, {

if (this.position.top !== prevTop) {
props.top = this.position.top + "px";
elemResized = true;
}
if (this.position.left !== prevLeft) {
props.left = this.position.left + "px";
elemResized = true;
}
if (this.size.width !== prevWidth) {
props.width = this.size.width + "px";
elemResized = true;
}
if (this.size.height !== prevHeight) {
props.height = this.size.height + "px";
elemResized = true;
}
el.css(props);

if (!this._helper && this._proportionallyResizeElements.length)
this._proportionallyResize();

// Call the user callback if the element was resized
if ( ! $.isEmptyObject(props) ) {
if (elemResized) {
this._trigger('resize', event, this.ui());
}

Expand Down

0 comments on commit e4958e1

Please sign in to comment.