Permalink
Browse files

Resizable: Removed call to $.isEmptyObject() to support jQuery < 1.4

  • Loading branch information...
1 parent 9a2b896 commit e4958e1afaf42362a5b6e9739a8427293f0d46df @eromba committed Jul 16, 2012
Showing with 7 additions and 2 deletions.
  1. +7 −2 ui/jquery.ui.resizable.js
@@ -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];
@@ -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());
}

0 comments on commit e4958e1

Please sign in to comment.