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 Nov 8, 2012
1 parent 29162c3 commit cc43360
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions ui/jquery.ui.resizable.js
Expand Up @@ -289,7 +289,8 @@ $.widget("ui.resizable", $.ui.mouse, {
var el = this.helper, props = {},
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 @@ -312,23 +313,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 cc43360

Please sign in to comment.