aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBen Hollis <ben@benhollis.net>2010-08-04 23:57:19 -0700
committerScott González <scott.gonzalez@gmail.com>2010-08-11 23:33:49 -0400
commit7692b6e65f27c9e37aaec45d92e120fbd43288d9 (patch)
treedea93a67529fa4b78dc6d0f1a8f4b6e7cbcfcedc
parent03eea0e39dc15b5fc8c811461dd7c08b9e09f660 (diff)
downloadjquery-ui-7692b6e65f27c9e37aaec45d92e120fbd43288d9.tar.gz
jquery-ui-7692b6e65f27c9e37aaec45d92e120fbd43288d9.zip
Position: Fix flip collision. Fixes #5932 - Position: flip collision handling is wrong in some cases.
-rw-r--r--ui/jquery.ui.position.js9
1 files changed, 6 insertions, 3 deletions
diff --git a/ui/jquery.ui.position.js b/ui/jquery.ui.position.js
index 50ef23d5a..8e2bc97f1 100644
--- a/ui/jquery.ui.position.js
+++ b/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;