]> source.dussan.org Git - jquery-ui.git/commitdiff
Position: Fix flip collision. Fixes #5932 - Position: flip collision handling is...
authorBen Hollis <ben@benhollis.net>
Thu, 5 Aug 2010 06:57:19 +0000 (23:57 -0700)
committerScott González <scott.gonzalez@gmail.com>
Thu, 12 Aug 2010 03:33:49 +0000 (23:33 -0400)
ui/jquery.ui.position.js

index 50ef23d5ae4edfcb61e6bde037ee7ce7a87dd69d..8e2bc97f1bb9bb3632e9f58d3006ad232974a212 100644 (file)
@@ -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;