]> source.dussan.org Git - jquery-ui.git/commitdiff
Position: Check to also make sure to only flip if more of the element is inside ... 464/head
authorkborchers <k_borchers@yahoo.com>
Fri, 16 Sep 2011 16:52:22 +0000 (11:52 -0500)
committerkborchers <k_borchers@yahoo.com>
Fri, 16 Sep 2011 16:52:22 +0000 (11:52 -0500)
ui/jquery.ui.position.js

index 24a033fc212758dd01608a44e763d4cc3f3b52d5..74530b9481d01bf9c080a405dd53b3e1e8bc691b 100644 (file)
@@ -376,7 +376,7 @@ $.ui.position = {
                                newOverBottom;
                        if ( overTop < 0 ) {
                                newOverBottom = position.top + myOffset + atOffset + offset + data.collisionHeight - outerHeight - withinOffset;
-                               if ( newOverBottom < 0 || newOverBottom < Math.abs( overTop ) ) {
+                               if ( ( position.top + myOffset + atOffset + offset) > overTop && ( newOverBottom < 0 || newOverBottom < Math.abs( overTop ) ) ) {
                                        data.elem
                                                .addClass( "ui-flipped-bottom" );
 
@@ -385,7 +385,7 @@ $.ui.position = {
                        }
                        else if ( overBottom > 0 ) {
                                newOverTop = position.top -  data.collisionPosition.marginTop + myOffset + atOffset + offset - withinOffset;
-                               if ( newOverTop > 0 || Math.abs( newOverTop ) < overBottom ) {
+                               if ( ( position.top + myOffset + atOffset + offset) > overBottom && ( newOverTop > 0 || Math.abs( newOverTop ) < overBottom ) ) {
                                        data.elem
                                                .addClass( "ui-flipped-top" );