Fixes #7018 Fixes #9107 Closes gh-1122
- Loading branch information
There are no files selected for viewing
@@ -341,14 +341,19 @@ $.widget("ui.resizable", $.ui.mouse, { | ||
el = this.helper, props = {}, | ||
smp = this.originalMousePosition, | ||
a = this.axis, | ||
dx = (event.pageX-smp.left)||0, | ||
dy = (event.pageY-smp.top)||0, | ||
trigger = this._change[a]; | ||
|
||
this.prevPosition = { | ||
top: this.position.top, | ||
left: this.position.left | ||
}; | ||
this.prevSize = { | ||
width: this.size.width, | ||
height: this.size.height | ||
}; | ||
|
||
if (!trigger) { | ||
return false; | ||
} | ||
@@ -369,16 +374,16 @@ $.widget("ui.resizable", $.ui.mouse, { | ||
// plugins callbacks need to be called first | ||
this._propagate("resize", event); | ||
|
||
if ( this.position.top !== this.prevPosition.top ) { | ||
props.top = this.position.top + "px"; | ||
} | ||
if ( this.position.left !== this.prevPosition.left ) { | ||
props.left = this.position.left + "px"; | ||
} | ||
if ( this.size.width !== this.prevSize.width ) { | ||
props.width = this.size.width + "px"; | ||
} | ||
if ( this.size.height !== this.prevSize.height ) { | ||
props.height = this.size.height + "px"; | ||
} | ||
el.css(props); | ||
@@ -662,7 +667,9 @@ $.widget("ui.resizable", $.ui.mouse, { | ||
position: this.position, | ||
size: this.size, | ||
originalSize: this.originalSize, | ||
originalPosition: this.originalPosition, | ||
prevSize: this.prevSize, | ||
prevPosition: this.prevPosition | ||
This comment has been minimized.
This comment has been minimized.
dekajp
Author
Contributor
|
||
}; | ||
} | ||
|
||
@@ -779,7 +786,7 @@ $.ui.plugin.add( "resizable", "containment", { | ||
} | ||
}, | ||
|
||
resize: function( event, ui ) { | ||
var woset, hoset, isParent, isOffsetRelative, | ||
that = $( this ).resizable( "instance" ), | ||
o = that.options, | ||
@@ -790,7 +797,8 @@ $.ui.plugin.add( "resizable", "containment", { | ||
top: 0, | ||
left: 0 | ||
}, | ||
ce = that.containerElement, | ||
continueResize = true; | ||
|
||
if ( ce[ 0 ] !== document && ( /static/ ).test( ce.css( "position" ) ) ) { | ||
cop = co; | ||
@@ -800,6 +808,7 @@ $.ui.plugin.add( "resizable", "containment", { | ||
that.size.width = that.size.width + ( that._helper ? ( that.position.left - co.left ) : ( that.position.left - cop.left ) ); | ||
if ( pRatio ) { | ||
that.size.height = that.size.width / that.aspectRatio; | ||
continueResize = false; | ||
} | ||
that.position.left = o.helper ? co.left : 0; | ||
} | ||
@@ -808,6 +817,7 @@ $.ui.plugin.add( "resizable", "containment", { | ||
that.size.height = that.size.height + ( that._helper ? ( that.position.top - co.top ) : that.position.top ); | ||
if ( pRatio ) { | ||
that.size.width = that.size.height * that.aspectRatio; | ||
continueResize = false; | ||
} | ||
that.position.top = that._helper ? co.top : 0; | ||
} | ||
@@ -829,15 +839,24 @@ $.ui.plugin.add( "resizable", "containment", { | ||
that.size.width = that.parentData.width - woset; | ||
if ( pRatio ) { | ||
that.size.height = that.size.width / that.aspectRatio; | ||
continueResize = false; | ||
} | ||
} | ||
|
||
if ( hoset + that.size.height >= that.parentData.height ) { | ||
that.size.height = that.parentData.height - hoset; | ||
if ( pRatio ) { | ||
that.size.width = that.size.height * that.aspectRatio; | ||
continueResize = false; | ||
} | ||
} | ||
|
||
if ( !continueResize ){ | ||
that.position.left = ui.prevPosition.left; | ||
that.position.top = ui.prevPosition.top; | ||
that.size.width = ui.prevSize.width; | ||
that.size.height = ui.prevSize.height; | ||
} | ||
}, | ||
|
||
stop: function(){ | ||
6 comments
on commit 20f0646
There was a problem hiding this comment.
@dekajp @mikesherov one of these resizable commits caused resizable-related failures in the dialog testsuite, for example http://swarm.jquery.org/result/1453910
Even just running the dialog tests locally in Chrome triggers a lot of console errors, along with dozens of failed tests.
There was a problem hiding this comment.
Ok, that's weird. I didn't see these failures when I tested it locally myself. Can we back this out for now?
There was a problem hiding this comment.
switched to ticket-7018
branch and ran the unit test on dialog on chrome browser in MacOs. I do not see any new
failures.https://github.com/dekajp/jquery-ui/tree/ticket-7018 . could be other resizable fixes - let me go thru each fixes
There was a problem hiding this comment.
@mikesherov @jzaefferer 7485
is where i see the failures in my local machine - 78 failed out of 402
https://github.com/dekajp/jquery-ui/commits/ticket-7485
There was a problem hiding this comment.
@mikesherov @jzaefferer : confirmed this commit has caused this issue - bae1a25
This changed the public API. We need to revert this part of the change. I've filed http://bugs.jqueryui.com/ticket/10148 to track this.