mirror of
https://github.com/jquery/jquery-ui.git
synced 2024-11-21 11:04:24 +00:00
Position: Fix flip collision. Fixes #5932 - Position: flip collision handling is wrong in some cases.
This commit is contained in:
parent
03eea0e39d
commit
7692b6e65f
9
ui/jquery.ui.position.js
vendored
9
ui/jquery.ui.position.js
vendored
@ -164,11 +164,14 @@ $.ui.position = {
|
||||
data.my[ 0 ] === "right" ?
|
||||
data.elemWidth :
|
||||
0,
|
||||
atOffset = data.at[ 0 ] === "left" ?
|
||||
data.targetWidth :
|
||||
-data.targetWidth,
|
||||
offset = -2 * data.offset[ 0 ];
|
||||
position.left += position.left < 0 ?
|
||||
myOffset + data.targetWidth + offset :
|
||||
myOffset + atOffset + offset :
|
||||
over > 0 ?
|
||||
myOffset - data.targetWidth + offset :
|
||||
myOffset + atOffset + offset :
|
||||
0;
|
||||
},
|
||||
top: function( position, data ) {
|
||||
@ -187,7 +190,7 @@ $.ui.position = {
|
||||
-data.targetHeight,
|
||||
offset = -2 * data.offset[ 1 ];
|
||||
position.top += position.top < 0 ?
|
||||
myOffset + data.targetHeight + offset :
|
||||
myOffset + atOffset + offset :
|
||||
over > 0 ?
|
||||
myOffset + atOffset + offset :
|
||||
0;
|
||||
|
Loading…
Reference in New Issue
Block a user