Position: Fix flip collision. Fixes #5932 - Position: flip collision handling is wrong in some cases.

This commit is contained in:
Ben Hollis 2010-08-04 23:57:19 -07:00 committed by Scott González
parent 03eea0e39d
commit 7692b6e65f

View File

@ -164,11 +164,14 @@ $.ui.position = {
data.my[ 0 ] === "right" ? data.my[ 0 ] === "right" ?
data.elemWidth : data.elemWidth :
0, 0,
atOffset = data.at[ 0 ] === "left" ?
data.targetWidth :
-data.targetWidth,
offset = -2 * data.offset[ 0 ]; offset = -2 * data.offset[ 0 ];
position.left += position.left < 0 ? position.left += position.left < 0 ?
myOffset + data.targetWidth + offset : myOffset + atOffset + offset :
over > 0 ? over > 0 ?
myOffset - data.targetWidth + offset : myOffset + atOffset + offset :
0; 0;
}, },
top: function( position, data ) { top: function( position, data ) {
@ -187,7 +190,7 @@ $.ui.position = {
-data.targetHeight, -data.targetHeight,
offset = -2 * data.offset[ 1 ]; offset = -2 * data.offset[ 1 ];
position.top += position.top < 0 ? position.top += position.top < 0 ?
myOffset + data.targetHeight + offset : myOffset + atOffset + offset :
over > 0 ? over > 0 ?
myOffset + atOffset + offset : myOffset + atOffset + offset :
0; 0;