aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ui/jquery.ui.position.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/ui/jquery.ui.position.js b/ui/jquery.ui.position.js
index bf741871b..9226909d5 100644
--- a/ui/jquery.ui.position.js
+++ b/ui/jquery.ui.position.js
@@ -232,10 +232,10 @@ $.fn.position = function( options ) {
horizontal: right < 0 ? "left" : left > 0 ? "right" : "center",
vertical: bottom < 0 ? "top" : top > 0 ? "bottom" : "middle"
};
- if ( Math.abs( left + right ) < targetWidth ) {
+ if ( targetWidth < elemWidth && Math.abs( left + right ) < targetWidth ) {
feedback.horizontal = "center";
}
- if ( Math.abs( top + bottom ) < targetHeight ) {
+ if ( targetHeight < elemHeight && Math.abs( top + bottom ) < targetHeight ) {
feedback.vertical = "middle";
}
if ( Math.max( Math.abs( left ), Math.abs( right ) ) > Math.max( Math.abs( top ), Math.abs( bottom ) ) ) {