Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Position: Fix flip collision. Fixes #5932 - Position: flip collision …

…handling is wrong in some cases.
  • Loading branch information...
commit 7692b6e65f27c9e37aaec45d92e120fbd43288d9 1 parent 03eea0e
@bhollis bhollis authored scottgonzalez committed
Showing with 6 additions and 3 deletions.
  1. +6 −3 ui/jquery.ui.position.js
View
9 ui/jquery.ui.position.js
@@ -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;

1 comment on commit 7692b6e

@jzaefferer
Owner

Nice. That code turned out to of the write-only kind, nice to see someone else could figure out what actually happens.

Please sign in to comment.
Something went wrong with that request. Please try again.